Font size
WorksheetsIntro to Python class open book quiz.
Total questions: 45
Worksheet time: 26mins
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
It displays an output
Spelling is not important in Python (it will know what you meant to type)
True
False
What does IDE stand for?
Integrated Development Environment
Internet Development Editor
Internet Development Environment
Icelandic Development Editor
What does \n do?
Adds a quotation
Creates a number
Adds a new line
Adds a fullstop
How will the following code look on the screen?
print ("I love programming.")
print ("I love programming.")
"I love programming."
"I love programming."
I love programming.
I love programming.
I love programming. I love programming.
I LOVE PROGRAMMING
I LOVE PROGRAMMING
The statement IF and ELSE allows us to:
quit
delete
compare
The == operator is a:
function operator
comparison operator
the opposite operator
code operator
A store your program must use as an identifier to keep track of a value is called a
Algorithm
Variable
Program
Assignment
An algorithm is a set of precise instructions designed to solve a problem.
True
False
Which symbol assigns a value to a variable?
(a)
Which of the following would be an example of a string variable:
ValidInput = False
GuessCount = 100
Name = "Bilbo"
Pi = 3.14159265359
Which of the following would be an example of a float variable:
ValidInput = False
GuessCount = 100
Name = "Bilbo"
Pi = 3.14159265359
What would be the result of 9 // 7
(a)
What would be the reult of 9 % 7
(a)
What would print (10 + 16) produce?
10
16
24
26
name=input("What is your name? ")
print("Your name is " + name)
What will be displayed if the user types in "Bob"?
Your name is name
name
Bob
Your name is Bob
What, if anything, is wrong with the following?
input("Type your password: ")
There is no variable
Input commands don't need ( )
Input commands don't need " "
Nothing is wrong
What, if anything, is wrong with the following?
input=x("Type your password: ")
print(x)
The variable should be switched with the input command
Input commands don't need ( )
You can't print x
Nothing is wrong
What, if anything, is wrong with the following?
x=input("Type your password: ")
print("You typed", x)
The variable should be switched with the input command
You can't use commas in print statements
You can't print x
Nothing is wrong
What, if anything, is wrong with the following?
x=input("Type your password: ")
print("You typed " + x)
The variable should be switched with the input command
You can't use + in print statements
You can't print x
Nothing is wrong
Is this sequence, selection, or repetition?
Sequence
Selection
Repetition
Which statements do we use for selection?
if statements
loops
sequential commands
Which of the following character is used to give single-line comments in Python?
//
#
<!-- -->
$
The result of this program:
Friday = False
if Friday:
print "Jeans day!"
else:
print "Uniform day"
Jeans day
Today is Friday
Uniform day
Not Friday
What is the output?
more than 7
more than 23
spam
7
What is the output?
250.0
200.0
300.0
350.0
If else statement
Outputs a message on the screen
Gets data from the user
A decision
A loop controlled by a decision
What will be outputted?
number is bigger than 10
nothing
an error
NUMBER IS BIGGER THAN 10
Which is NOT a data type in Python?
integer
boolean
anchor
float
Which is correct?
A
B
What is the name of the variable in this program?
colour
input
" "
print( (a) ("What is your favourite colour?")
What is the correct term for this symbol?
" "
Quotation marks
Bunny fingers
Parenthesis
Exclamation mark
