Deck 2: Input, Processing, and Output

Full screen (f)
exit full mode
Question
The output of the following print statement is: print 'I\'m ready to begin'

A) Im ready to begin
B) I\'m ready to begin
C) I'm ready to begin
D) 'I\'m ready to begin'
Use Space or
up arrow
down arrow
to flip the card.
Question
The _____ function 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.

A) input
B) output
C) eval_input
D) string_input
Question
Python allows programmers to break a statement into multiple lines.
Question
The _____ built-in function is used to read a number that has been typed on the keyboard.

A) input()
B) read()
C) get()
D) keyboard()
Question
A(n) _____ is a diagram that graphically depicts the steps that take place in a program.

A) flowchart
B) algorithm
C) code
D) pseudocode
Question
The program development cycle is made up of _____ steps that are repeated until no errors can be found in the program.

A) five
B) four
C) three
D) six
Question
After the execution of the following statement, the variable sold will reference the numeric literal value as a(n) _____ data type: sold = 256.752

A) int
B) float
C) str
D) currency
Question
The line continuation character is a _____.

A) #
B) %
C) &
D) \
Question
Which mathematical operator is used to raise five to the second power in Python?

A) /
B) **
C) ^
D) ~
Question
What is the output of the following print statement? print('The path is D:\\sample\\test.')

A) 'The path is D:\\sample\\test.'
B) The path is D:\\sample\\test.
C) The path is D\\sample\\test.
D) The path is D:\sample\test.
Question
Python formats all floating-point numbers to two decimal places when outputting using the print statement.
Question
If value1 is 2.0 and value2 is 12, what is the output of the following command? print(value1 * value2)

A) 24
B) value1 * value2
C)24.0
D)2.0 * 12
Question
What type of error produces incorrect results but does not prevent the program from running?

A) syntax
B) logic
C) grammatical
D) human
Question
When using the camelCase naming convention, the first word of the variable name is written in lowercase letters and the first character of the second and subsequent words are written in uppercase letters.
Question
According to the behavior of integer division, when an integer is divided by an integer, the result will be a float.
Question
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.

A) stop
B) end
C) separator
D) newLine
Question
What is the informal language that programmers use to create models of programs that have no syntax rules and are not meant to be compiled or executed?

A) flowchart
B) Algorithm
C) Code
D) Pseudocode
Question
After the execution of the following statement, the variable price will reference the value _____. price = int(68.549)

A) 68
B) 69
C)68.55
D)68.54
Question
Comments in Python begin with the # character.
Question
What symbol is used to mark the beginning and end of a string?

A) Slash
B) Asterisk
C) Quotation
D) Comma
Question
A(n) _______________ character is a special character that is preceded with a backslash, appearing inside a string literal.
Question
A(n) _______________ is a name that represents a value stored in the computer's memory.
Question
A flowchart is a tool that programmers use to design programs.
Question
The result of the expression 12.3 + 6.7 is _______________.
Question
When the + operator is used with two strings, it performs string _______________.
Question
A(n) _______________ is a single task that the program must perform in order to satisfy the customer.
Question
In Python, math expressions are evaluated from left to right, no matter what the operators are.
Question
The \t escape character causes the output to skip over to the next horizontal tab.
Question
Computer programs typically perform three steps: Input is received, some process is performed on the input, and output is produced.
Question
When applying the .3f formatting specifier to the following number, 76.15854, the result is _______________.
Question
Python uses _______________ to categorize values in memory.
Question
The _______________ specifier is a special set of characters that specify how a value should be formatted.
Question
_______________ are notes of explanation that document lines or sections of a program.
Question
The % symbol is the remainder operator and it is also known as the _______________ operator.
Question
In Python, print statements written on separate lines do not necessarily output on separate lines.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 2: Input, Processing, and Output
1
The output of the following print statement is: print 'I\'m ready to begin'

A) Im ready to begin
B) I\'m ready to begin
C) I'm ready to begin
D) 'I\'m ready to begin'
C
2
The _____ function 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.

A) input
B) output
C) eval_input
D) string_input
A
3
Python allows programmers to break a statement into multiple lines.
True
4
The _____ built-in function is used to read a number that has been typed on the keyboard.

A) input()
B) read()
C) get()
D) keyboard()
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
5
A(n) _____ is a diagram that graphically depicts the steps that take place in a program.

A) flowchart
B) algorithm
C) code
D) pseudocode
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
6
The program development cycle is made up of _____ steps that are repeated until no errors can be found in the program.

A) five
B) four
C) three
D) six
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
7
After the execution of the following statement, the variable sold will reference the numeric literal value as a(n) _____ data type: sold = 256.752

A) int
B) float
C) str
D) currency
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
8
The line continuation character is a _____.

A) #
B) %
C) &
D) \
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
9
Which mathematical operator is used to raise five to the second power in Python?

A) /
B) **
C) ^
D) ~
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
10
What is the output of the following print statement? print('The path is D:\\sample\\test.')

A) 'The path is D:\\sample\\test.'
B) The path is D:\\sample\\test.
C) The path is D\\sample\\test.
D) The path is D:\sample\test.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
11
Python formats all floating-point numbers to two decimal places when outputting using the print statement.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
12
If value1 is 2.0 and value2 is 12, what is the output of the following command? print(value1 * value2)

A) 24
B) value1 * value2
C)24.0
D)2.0 * 12
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
13
What type of error produces incorrect results but does not prevent the program from running?

A) syntax
B) logic
C) grammatical
D) human
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
14
When using the camelCase naming convention, the first word of the variable name is written in lowercase letters and the first character of the second and subsequent words are written in uppercase letters.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
15
According to the behavior of integer division, when an integer is divided by an integer, the result will be a float.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
16
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.

A) stop
B) end
C) separator
D) newLine
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
17
What is the informal language that programmers use to create models of programs that have no syntax rules and are not meant to be compiled or executed?

A) flowchart
B) Algorithm
C) Code
D) Pseudocode
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
18
After the execution of the following statement, the variable price will reference the value _____. price = int(68.549)

A) 68
B) 69
C)68.55
D)68.54
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
19
Comments in Python begin with the # character.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
20
What symbol is used to mark the beginning and end of a string?

A) Slash
B) Asterisk
C) Quotation
D) Comma
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
21
A(n) _______________ character is a special character that is preceded with a backslash, appearing inside a string literal.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
22
A(n) _______________ is a name that represents a value stored in the computer's memory.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
23
A flowchart is a tool that programmers use to design programs.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
24
The result of the expression 12.3 + 6.7 is _______________.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
25
When the + operator is used with two strings, it performs string _______________.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
26
A(n) _______________ is a single task that the program must perform in order to satisfy the customer.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
27
In Python, math expressions are evaluated from left to right, no matter what the operators are.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
28
The \t escape character causes the output to skip over to the next horizontal tab.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
29
Computer programs typically perform three steps: Input is received, some process is performed on the input, and output is produced.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
30
When applying the .3f formatting specifier to the following number, 76.15854, the result is _______________.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
31
Python uses _______________ to categorize values in memory.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
32
The _______________ specifier is a special set of characters that specify how a value should be formatted.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
33
_______________ are notes of explanation that document lines or sections of a program.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
34
The % symbol is the remainder operator and it is also known as the _______________ operator.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
35
In Python, print statements written on separate lines do not necessarily output on separate lines.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 35 flashcards in this deck.