NEW
Font size
WorksheetsPython Exam 2 (Intro to comp sci 4_30_20)
Total questions: 20
Worksheet time: 2hrs 35mins
Which algorithm correctly expresses the following scenario?
If studentA has a minimum average of 80 and a SAT score of at least 950, they will be accepted into the university.
Which choice below appropriately uses the '.format' command to produce the same output as the print statement on line 5 of this code?
What is choice best explains the error that will be output in the IDLE when this code is executed?
Name error: depositAmt not defined
Syntax error: float not defined
Type Error: can only concatenate str to str
Type Error: can only concatenate float to float
Which term most closely defines the word 'concatenate'?
combine
separate
break down
order
What symbol is used in python to assign values to a variable?
==
=
()
*
When you have an error in your code, what is the computer science term used to for finding and fixing that error?
Error checking
Debugging
Syntax locating
Error finder
What would print ("10 + 16") produce?
26
"26"
1016
10 + 16
What output would print ("8" + "11") produce?
811
19
8 + 11
"19"
What does the following code do?
myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
What is the name of the environment in Python where write your programs and then test them out?
Shell
Window
IDLE
CLI
What will be the output when this code is executed?
You have deposited $500 and your final balance is $4000
4000
Name error: balance is not defined
4000
Type error: can't concatenate str and int
Numbers with a decimal point belong to a datatype called...
pointing
integers
decimal
float
True or False:
A variable can hold only one value at a time.
True
False
