NEW
Font size
WorksheetsPython Revisoin
Total questions: 23
Worksheet time: 12mins
What is the output?
Alison
name
6
number
Which of the following is NOT a valid conditional statement in Python?
elif
then
if
else
Which character is used to start a Python comment?
#
&
!
/
I need a program that will keep letting me add a monthly payment for 12 months.
FOR Loop
WHILE Loop
if-statement
What is the output?
A
B
A
C
A
C
What would amount equal in this piece of code:
amount = 2 + 5 * 2
12
9
14
5
When we want to test multiple conditions we use elif statement.
True
False
There can be an else statement without an if statement.
True
False
Which is the correct way to store an input as a variable in Python?
answer("what is your name?")
answer = input("what is your name?")
input = "answer"(what is your name?)
input=(what is your name?)
Which value is a String?
64
"cat"
True
0.5
What type of data is the following?: X = "195.67"
Float
String
Boolean
integer
print("Python " * 3); will print out what
Python 3 Python 3 Python 3
PythonPythonPython
Python Python Python
Python*3 Python*3 Python*3
To check if a person's age is more than 18 or no, what data type will you use?
String
Integer
float
boolean
What is the output of the code?
"String"
18
"No string"
age
Code executed based on a condition being true is:
Sequence
Selection
Variable
Iteration
What is the output from this program?
condition
True
Program has a syntax error
3 > 2
Which syntax would you use to create a name variable?
name=input()
input=name
name=input{}
name=INPUT
What will the output be from the following code? print("3+4")
7
3+4
34
“3+4”
What will the output be from the following code? print(3*4+5)
27
17
12
syntax error
What does the following code do? myAge = int (myAge)
Converts the variable myAge to a string
Converts the variable myAge to a integer
Converts the variable myAge from a integer to a string
What is the Python built-in function to converts a number to a string?
str()
int()
parseInt()
convert
Which of these is correctly coded?
num = int(input()
num = int(input('Please enter a number: ')
num = int(input('Please enter your age: '))
num = input('Enter a number value )
What is the answer to the expression , 22%3?
5
7
0
1
