Deck 2: Input, Processing, and Output

Full screen (f)
exit full mode
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
Use Space or
up arrow
down arrow
to flip the card.
Question
Comments in Python begin with the # character.
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
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
The line continuation character is a _____.

A) #
B) %
C) &
D) \
Question
Python formats all floating-point numbers to two decimal places when outputting using the print statement.
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
What symbol is used to mark the beginning and end of a string?

A) Slash
B) Asterisk
C) Quotation
D) Comma
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'
Question
Python allows programmers to break a statement into multiple lines.
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
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
Which mathematical operator is used to raise five to the second power in Python?

A) /
B) **
C) ^
D) ~
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 _____ 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
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
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
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
According to the behavior of integer division, when an integer is divided by an integer, the result will be a float.
Question
Python uses _______________ to categorize values in memory.
Question
When applying the .3f formatting specifier to the following number, 76.15854, the result is _______________.
Question
A flowchart is a tool that programmers use to design programs.
Question
The % symbol is the remainder operator and it is also known as the _______________ operator.
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
A(n) _______________ character is a special character that is preceded with a backslash, appearing inside a string literal.
Question
The result of the expression 12.3 + 6.7 is _______________.
Question
The \t escape character causes the output to skip over to the next horizontal tab.
Question
A(n) _______________ is a single task that the program must perform in order to satisfy the customer.
Question
When the + operator is used with two strings, it performs string _______________.
Question
A(n) _______________ is a name that represents a value stored in the computer's memory.
Question
In Python, print statements written on separate lines do not necessarily output on separate lines.
Question
Computer programs typically perform three steps: Input is received, some process is performed on the input, and output is produced.
Question
In Python, math expressions are evaluated from left to right, no matter what the operators are.
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
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
C
2
Comments in Python begin with the # character.
True
3
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
B
4
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
5
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
6
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
7
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
8
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
9
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'
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
10
Python allows programmers to break a statement into multiple lines.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
11
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
12
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
13
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
14
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
15
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
16
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
17
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
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
18
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
19
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
20
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
21
Python uses _______________ to categorize values in memory.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
22
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
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 % 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
25
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
26
_______________ 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
27
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
28
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
29
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
30
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
31
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
32
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
33
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
34
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
35
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
locked card icon
Unlock Deck
Unlock for access to all 35 flashcards in this deck.