Docsity

Starting OUT WITH Python 6 Learning Workbook Python Basics DATA TYPES AND Control Structur, Exams of Medicine

Toggle sidebar
bg1
Starting OUT WITH Python 6 Learning Workbook
Python Basics DATA TYPES AND Control
Structures Exam Questions and Answers Verified
Solutions Latest Update (2026/2027)
Question:
The physical devices, or components, of which a computer is
made of are referred to as _____?
Answer:
Hardware
Question:
List the five major components of a computer system.
Answer:
The CPU, main memory, secondary storage devices, input devices,
and output devices.
Question:
What part of the computer actually runs programs?
Answer:
Central Processing Unit (CPU)
Question:
What part of the computer serves as a work area to store a
program and its data while the program is running?
Answer:
Main
memory or Random Access Memory (RAM)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Starting OUT WITH Python 6 Learning Workbook Python Basics DATA TYPES AND Control Structur and more Exams Medicine in PDF only on Docsity!

Starting OUT WITH Python 6 Learning Workbook

Python Basics DATA TYPES AND Control

Structures Exam Questions and Answers Verified

Solutions Latest Update (2026/2027)

Question:

The physical devices, or components, of which a computer is made of are referred to as _____?

Answer:

Hardware

Question:

List the five major components of a computer system.

Answer:

The CPU, main memory, secondary storage devices, input devices, and output devices.

Question:

What part of the computer actually runs programs?

Answer:

Central Processing Unit (CPU)

Question:

What part of the computer serves as a work area to store a program and its data while the program is running?

Answer:

Main memory or Random Access Memory (RAM)

What part of the computer holds data for long periods of time, even where there is no power to the computer?

Answer:

Secondary storage devices (Disk drive, SSD, USB Drive, flash drives, optical drives)

Question:

What part of the computer formats and presents data for people or other devices?

Answer:

Output devices

Question:

What fundamental set of programs control the internal operations of the computer's hardware?

Answer:

Operating Systems

Question:

What do you call a program that performs a specialized task, such as a virus scanner, a file compression program, or a data backup program?

Answer:

Utility Programs

Question:

Word processing programs, spreadsheet programs, email programs, web browsers, and game programs belong to what category of software?

Answer:

Application Software

A _________ is enough memory to store a letter of the alphabet or a small number.

Answer:

Byte

Question:

A byte is made up of eight _____.

Answer:

Bits

Question:

In the __________ numbering system, all numeric values are written as sequences of 0's and 1's.

Answer:

Question:

function

Answer:

a group of statements that exist within a program for the purpose of performing a specific task

Question:

modularized program

Answer:

a program that has been written with each task in its own function; benefits include simpler code, code reuse, better testing, faster development, easier facilitation of teamwork.

void function

Answer:

executes the statements it contains and then terminates

Question:

value returning function

Answer:

executes the statements it contains, and then it returns a value back to the statement that called it; ex. input function, int, float

Question:

function definition

Answer:

the code for a function; specifies what a function does

Question:

function header

Answer:

the first line in a function that begins with the key word def; marks the beginning of the function definition

Question:

block

Answer:

a set of statements that belong together as a group; performed any time the function is executed

scope

Answer:

the part of a program in which the variable may be accessed. a variable is visible only to statements in the variable's scope. a local variable's scope is the function in which the variable is created.

Question:

argument

Answer:

any piece of data that is passed into a function when the function is called

Question:

parameter

Answer:

a variable that receives an argument that is passed into a function; a special variable that is assigned the value of an argument when a function is called.

Question:

parameter variable scope

Answer:

the function in which the parameter is used; all of the statements inside the function can access the parameter variable, but no statement outside the function can access it.

Question:

by position

Answer:

the first argument is passed to the first

parameter variable, and the second argument is passed to the second argument parameter

Question:

true

Answer:

any changes to that are made to the parameter variable will not affect the argument

Question:

pass by value

Answer:

The form of argument passing that is used in Python, where a function cannot change the value of an argument that was passed to it.

Question:

keyword argument

Answer:

An argument that includes the name of the parameter as a "keyword."; specifies which parameter variable the argument should be passed to

Question:

true

Answer:

it is possible to mix positional arguments and keyword arguments in a function call, but the positional arguments must appear first followed by the keyword argumens

randrange function

Answer:

similar to range function; returns a randomly selected value from a sequence of values; ex number = random. randomrange(10)

Question:

random function

Answer:

returns a random floating point number in the range of 0.0 up to (but not including) 1. ex number = random. random( )

Question:

uniform function

Answer:

returns a random floating point number but allows you to specify the range of values to select from; ex: number = random. uniform(1.0, 10,0)

Question:

psuedorandom numbers

Answer:

the numbers that are generated by the function in the random module are not truly random, the are actually ________ that are calculated by a formula

Question:

seed value

Answer:

the formula that generates random numbers has to be initialized with a value known as a _______.; used in the

calculation that returns the next random number in the series

Question:

value returning statement

Answer:

has a return statement that returns a value back to the part of the program that called it; must have a return statement

Question:

IPO chart

Answer:

a simple but effective tool programmers use for designing and documenting functions (Input Processing Output); describes the input, processing, and output of a function.

Question:

math module

Answer:

contains numerous functions that can be used in mathematical calculations

Question:

module

Answer:

a file that contains Python code; large programs are easier to debug and maintain when they are divided into modules

Question:

Output file

Answer:

A file that data is written to.

Sequential access

Answer:

When working with this type of fike, you access its data from the beginning of the file to the end of the file.

Question:

Direct access

Answer:

When working with this type of file, you can jump directly to any piece of data in the file without reading the data that come before it.

Question:

Buffer

Answer:

This is a small "holding section" in memory that many systems write data to before writing the data to a file.

Question:

Read position

Answer:

This marks the location of the next item that will be read from a file.

Question:

Append mode

Answer:

When a file is opened in this mode, data will be written at the end of the file's existing contents.

Field

Answer:

This is a single piece of data within a record.

Question:

Raised

Answer:

This occurs when an exception is generated.

Question:

Exception handler

Answer:

This is a section of code that gracefully responds to exceptions.

Question:

Try/except

Answer:

You write this statement to respond to exceptions.

Question:

cookie

Answer:

A small web page file stored on your computer

Question:

filename extensionos

Answer:

short sequences of characters that appear at the end of a filename preceded by a period

record

Answer:

complete set of data that describes one item

Question:

traceback

Answer:

An error message that gives information regarding the line numbers that caused the exception

Question:

exception

Answer:

An error that occurs while a program is running.

Question:

try suite

Answer:

one or more statements that can potentially raise an exception

Question:

exception object

Answer:

contains various data about an exception; created when an exception is thrown.

Else suite

Answer:

block of statements executed after statements in try suite, only if no exceptions were raised

Question:

finally suite

Answer:

block of statements after the finally clause. Always executed after the try suite has executed, and after any exception handlers have executed. Executes whether an exception occurs or not.