Docsity

Starting OUT WITH Python 6 Comprehensive Study Guide Programming Fundamentals AND Problem, Exams of Medicine

Toggle sidebar
bg1
Starting OUT WITH Python 6 Comprehensive
Study Guide Programming Fundamentals
AND Problem Solving Questions and Answers
Verified Solutions Latest Update (2026/2027)
Question:
Logic Error.
Answer:
An error in a program that makes it do
something other than what the programmer intended. It does not
prevent the program from running, but causes it to produce
incorrect results. Mathematical mistakes are common causes of logic
errors.
Question:
debugging.
Answer:
Finding and fixing problems in your
algorithm or program.
Question:
algorithm.
Answer:
a set of well-defined logical steps that must be
taken to perform a task.
Question:
pseudocode.
Answer:
Shorthand notation for programming which
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Starting OUT WITH Python 6 Comprehensive Study Guide Programming Fundamentals AND Problem and more Exams Medicine in PDF only on Docsity!

Starting OUT WITH Python 6 Comprehensive

Study Guide Programming Fundamentals

AND Problem Solving Questions and Answers

Verified Solutions Latest Update (2026/2027)

Question:

Logic Error.

Answer:

An error in a program that makes it do something other than what the programmer intended. It does not prevent the program from running, but causes it to produce incorrect results. Mathematical mistakes are common causes of logic errors.

Question:

debugging.

Answer:

Finding and fixing problems in your algorithm or program.

Question:

algorithm.

Answer:

a set of well-defined logical steps that must be taken to perform a task.

Question:

pseudocode.

Answer:

Shorthand notation for programming which

uses a combination of informal programming structures and verbal descriptions of code.

Question:

Flowcharts.

Answer:

A graphical representation of the steps in a process; details all of the elements in a process and the sequence in which these elements occur. This a tool that programmers use to design programs

Question:

terminal symbols.

Answer:

The ovals that appear at the top and bottom of the flowchart. The start terminal marks the starting point, and the End terminal marks the program's ending point.

Question:

input symbol.

Answer:

indicates an input operation and is represented by a parallelogram in flowcharts

Question:

output symbol.

Answer:

indicates an output operation and is represented by a parallelogram in flowcharts

Flowchart.

Answer:

a diagram that graphically depicts the steps that take place in a program

Question:

Input.

Answer:

any data that the program receives while it is running.

Question:

A function.

Answer:

is a piece of pre-written code that performs an operation.

Question:

Calling a function.

Answer:

what programmers say when they execute a function.

Question:

argument.

Answer:

the data that you want displayed on the screen

string.

Answer:

a sequence of characters that is used as data.

Question:

string literal.

Answer:

When a string appears in the actual code of a program.

Question:

single or double quotation marks.

Answer:

In Python, string literals must be enclosed in ________________________

Question:

double-quote marks.

Answer:

If you want a string literal to contain either a single-quote or apostrophe as part of the string, can can enclose the string literal in

Question:

triple quotes.

Answer:

Python also allows you to enclose string literal in ________ __________, why? If the string contains both single- quote marks and double-quote marks.

assignment statement.

Answer:

You use an ______________________ __________________ to create a variable and make it reference a piece of data.

Question:

variable = expression.

Answer:

assignment statement is written in this general format

Question:

assignment operator.

Answer:

The = sign is know as the

Question:

quotation marks.

Answer:

When you pass a variable as a argument to the print function, you do NOT enclose the variable name in ___________ _____________.

Question:

In an assignment statement, the variable that is receiving the assignment must appear on the.

Answer:

left side of the = operator

You cannot use a variable until you have.

Answer:

assigned a value to it.

Question:

Variable Naming Rules.

Answer:

  1. You cannot use one of Python's key words.
  2. It cannot contain spaces.
  3. The first character must be one of the letters a through z, A through Z, or an underscore character ( _ )
  4. After the first character you may use the letters a through z or A through Z, the digits 0 through 9, or underscores.
  5. Uppercase and lowercase characters are distinct; they matter.

Question:

garbage collection.

Answer:

Releases memory that was used for a variable's value once the variable is no longer to be used by a program.

Question:

variable reassignment.

Answer:

to change the value of a variable based on its current value

str.

Answer:

A Python data type that holds a string of characters. (used for storing strings in memory)

Question:

variable.

Answer:

Keep in mind that in Python, a ___________ is just a name that refers to a piece of data When a program reads data from the keyboard, usually it stores that data in a ___________ so it can be used later by the program (same answer)

Question:

nested function calls.

Answer:

where one function calls another

Question:

end.

Answer:

In a print statement, you can set the _____ argument to a space or empty string to stop the output from advancing to a new line.

Question:

an algorithm allows ambiguity.

Answer:

Which of the following is not true? An algorithm, when carried out, must eventually stop

An algorithm allows ambiguity An algorithm, can be carried out by a human being

Question:

logic.

Answer:

The purpose of testing a program with different combinations of data is to expose run-time and ____ errors.

Question:

String constant.

Answer:

a specific group of characters enclosed within quotation marks

Question:

empty string.

Answer:

A string value that has no characters, represented in code as "".

Question:

variable.

Answer:

A location in memory used for storing data and given a name in a computer program is called a _________ because the data in the location can be changed.

Question:

foreground = "red".

Answer:

Associate the variable foreground with the value "red".

assign a value; it will reference that value until you assign it a different value.

Question:

whole number.

Answer:

A numeric literal that is written as a _____________ ______________ with no decimal point is considered an int

Question:

decimal point.

Answer:

A numeric literal that is written as a ______________ _____________ is considered a float

Question:

input function.

Answer:

reads a piece of data that has been entered at the keyboard and returns that piece of data, as a string, back to the program - you normally us this function in an assignment statement

Question:

prompt.

Answer:

In the general format, _____________ is a string that is displayed on the screen.

Question:

exception.

Answer:

an unexpected error that occurs while a

program is running, causing the program to halt if the error is not properly dealth with.

Question:

math operators.

Answer:

a programmer's tools for performing calculations

Question:

Answer:

Python addition operator that adds two numbers

Question:

_.

Answer:

Python subtraction operator that subtracts one number from another

Question:

Answer:

Python multiplication operator that multiplies on number by another

Question:

Answer:

Python division operator that divides on number by another and gives the result as a floating-point number

line continuation character.

Answer:

Python allows you to break a statement into multiple lines by using this; which is a backslash ( \ ) You simply type the backslash character (no parentheses) where you want to break the statement, then press the Enter key.

Question:

parentheses.

Answer:

Python also allows you to break any part of a statement that is enclosed in ________________ without using the line continuation character.

Question:

newline character.

Answer:

You can think of this as a special command that causes the computer to start a new line of output (you do not see it, but when it is displayed, it causes the output to advance to the next line)

Question:

end=' '.

Answer:

A keyword parameter for the print() function that causes the function to NOT add a newline at the end of the string. (there is a space between the quotes)

end=''.

Answer:

A keyword parameter for the print() function that causes the function to NOT add a newline at the end of the string and NOT add a space (there is not space between the quotes.

Question:

sep=''.

Answer:

When multiple arguments are passed to the print function, they are automatically separated by a space when they are displayed on the screen, if you do NOT want a space printed between the items; you can pass this argument to the print function ie: OneTwoThree

Question:

sep='*'.

Answer:

You can also tell this special argument to specify a character other than a space to separate multiple items ie: OneTwoThree (you can use any character)

Question:

escape character.

Answer:

is a special character that is preceded with a backslash ( \ ), appearing inside a string literal, for example: \n

\.

Answer:

Causes a backslash character to be printed; in Python ie: print('The path is C:\temp\data.') required when you want to print a backslash; a single one will not work in Python.

Question:

string concatenation.

Answer:

This means that when using the plus sign + between string; itappeand one string to another ie: print('This is ' + 'one string.') will print: This is one string. It is useful for breaking up a string literal so a lengthy call to the print function can span multiple lines.

Question:

format function.

Answer:

When you call the built-in format function, you pass two arguments to the function: a numeric value and a format specifier. Python has built-in format function that allow decimal places to be rounded a more. format( )

format specifier.

Answer:

is a string that contains special characters specifying how the numeric value should be formatted

Question:

'.2f'.

Answer:

A format specifier in Python that prints 2 decimal spaces; you can change the number to any number of decimal spaces

Question:

e.

Answer:

If you prefer to display floating-point numbers in scientific notation, you can use this letter (either capitalized or not) instead of f ie: print(format(12345.6789, 'e')) will print: 1.234568= ie: print(format(12345.6789, '.2e')) will print: 1.23e+

Question:

Format specifier Minimum Field Width.

Answer:

the minimum number of spaces that should be allowed to display the value ie: print('The number is, format(12345.6789, '12.2f))