Docsity

Starting Out with Python 6 Programming Exam 2026: 94 Practice Questions and Correct Answer, Exams of Nursing

Toggle sidebar
bg1
Question 1.
Logic Error.
Correct 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 2.
debugging.
Correct Answer: Finding and fixing problems in your algorithm or program.
Question 3.
algorithm.
Correct Answer: a set of well-defined logical steps that must be taken to
perform a task.
Question 4.
pseudocode.
Correct Answer: Shorthand notation for programming which uses a
combination of informal programming structures and verbal
descriptions of code.
Question 5.
Flowcharts.
Correct 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 6.
terminal symbols.
Correct 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.
Starting Out with Python 6 Programming Exam 2026: 94 Practice
Questions and Correct Answers
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Starting Out with Python 6 Programming Exam 2026: 94 Practice Questions and Correct Answer and more Exams Nursing in PDF only on Docsity!

Question 1. Logic Error. Correct 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 2. debugging. Correct Answer: Finding and fixing problems in your algorithm or program.

Question 3. algorithm. Correct Answer: a set of well-defined logical steps that must be taken to perform a task.

Question 4. pseudocode. Correct Answer: Shorthand notation for programming which uses a combination of informal programming structures and verbal descriptions of code.

Question 5. Flowcharts. Correct 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 6. terminal symbols. Correct 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.

Starting Out with Python 6 Programming Exam 2026: 94 Practice

Questions and Correct Answers

input symbol.

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

Question 8.

output symbol.

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

Question 9.

Processing Symbols:.

Correct Answer: represent steps in which the program performs some process on data, such as a mathematical calculation. (rectangle in a flow chart)

Question 10.

programmer's customer.

Correct Answer: Any person, group, or organization that is asking you to write a program.

Question 11.

software requirement.

Correct Answer: is simply a single task that the program must perform in order to satisfy the customer

Question 12.

algorithm.

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

Question 13.

pseudocode.

Correct Answer: a cross between human language and a programming language. Although the computer can't understand it; programmers often find it helpful to plan an algorithm in a language that's almost a programming language but still very readable by humans.

single or double quotation marks.

Correct Answer: In Python, string literals must be enclosed in

Question 22.

double-quote marks.

Correct 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 23.

triple quotes.

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

Question 24.

comments.

Correct Answer: short notes placed in different parts of a program, explaining how those parts of the program work. They are intended for any person reading a program's code, not the computer.

Question 25.

character.

Correct Answer: In Python you begin a comment with this character. When the interpreter sees it, it ignores everything from that character to the end of the line.

Question 26.

end-line comment.

Correct Answer: a comment that appears at the end of a line of code

Question 27.

A variable.

Correct Answer: is a name that represents a value stored in the computer's memory. Programs use this to access and manipulate data that is stored in memory.

references the value.

Correct Answer: When a variable represents a value in the computer's memory, we say that the variable _________.

Question 29.

assignment statement.

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

Question 30.

variable = expression.

Correct Answer: assignment statement is written in this general format

Question 31.

assignment operator.

Correct Answer: The = sign is know as the ______________ _______________

Question 32.

quotation marks.

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

Question 33.

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

Correct Answer: left side of the = operator

Question 34.

You cannot use a variable until you have.

Correct Answer: assigned a value to it.

You cannot write _________,___________,___________in numeric literals.

Correct Answer: currency symbols, spaces, or commas

Question 43.

str.

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

Question 44.

variable.

Correct 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 45.

nested function calls.

Correct Answer: where one function calls another

Question 46.

end.

Correct 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 47.

an algorithm allows ambiguity.

Correct 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 48.

logic.

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

String constant.

Correct Answer: a specific group of characters enclosed within quotation marks

Question 50.

empty string.

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

Question 51.

variable.

Correct 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 52.

foreground = "red".

Correct Answer: Associate the variable foreground with the value "red".

Question 53.

method invocation.

Correct Answer: the line of code that causes a method to be executed

Question 54.

price%100.

Correct Answer: Assume that price is an integer variable whose value is the price (in US currency) in cents of an item. Assuming the item is paid for with a minimum amount of change and just single dollars, write an expression for the amount of change (in cents) that would have to be paid.

Question 55.

x%10.

Correct Answer: Assume that a variable x has been assigned a integer value,.

Write an expression whose value is the last (rightmost) digit of x.

math operators.

Correct Answer: a programmer's tools for performing calculations

Question 64.

+.

Correct Answer: Python addition operator that adds two numbers

Question 65.

_.

Correct Answer: Python subtraction operator that subtracts one number from another

Question 66.

*.

Correct Answer: Python multiplication operator that multiplies on number by another

Question 67.

/.

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

Question 68.

//.

Correct Answer: Python Integer division operator that divides one number by another and gives the result as a whole number

Question 69.

%.

Correct Answer: Python remainder operator that divides one number by another and gives the remainder

Correct Answer: Python exponent operator that raises a number to a power

Question 71.

operands.

Correct Answer: values that the + operator add together

Question 72.

mixed-type expression.

Correct Answer: An expression that contains operands of different data types; also called mixed mode expression

Question 73.

line continuation character.

Correct 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 74.

parentheses.

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

Question 75.

newline character.

Correct 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 76.

end=' '.

Correct 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)

'.

Correct Answer: Causes a single quotation mark to be printed in Python ie: print('I'm ready to begin') -instead of

print("I'm ready to begin") both work in Python

Question 84.

''.

Correct Answer: Causes a double quotation mark to be printed in Python ie: print("Your assignment is to read "Hamlet" by tomorrow.") -instead of print('Your assignment is to read"Hamlet" by tomorrow.') both work in Python

Question 85.

\.

Correct 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 86.

string concatenation.

Correct 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 87.

format function.

Correct 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( )

Question 88.

format specifier.

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

'.2f'.

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

Question 90.

e.

Correct 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 91.

Format specifier Minimum Field Width.

Correct Answer: the minimum number of spaces that should be allowed to display the value ie: print('The number is, format(12345.6789, '12.2f)) The number is 12,345.68 This is for 12 spaces with 2 decimal points; this is for when numbers need to be printed in columns; it will be right justified (their decimal points will be aligned.

Question 92.

Formatting a Floating-Point Number as a Percentage.

Correct Answer: Instead of using f as the type designator , use the % symbol

Question 93.

Named Constant.

Correct Answer: is a name that represents a value that cannot be changed during the program's execution.

Question 94.

use d as the type designator.

Correct Answer: How do you use the format function to format integers? They are written in all upper case. Used with magic numbers.