Font size
WorksheetsPython Quiz
Total questions: 60
Worksheet time: 31mins
name = 'Dave'
print (name)
Which is the Python logo?
What is a input?
A function that allows us to ask the user to enter some data.
To plug in something.
Data displayed on a screen.
A function
What function is used to output a message in python?
print("")
input=name
name=input
x = 5
y = 6
print(x*y)
The code above displays the following:
11
x*y
Syntax Error
30
Operators used in python:
divide, multiply, add, subtract
/, *, +, -
div, mul, +, -
\, x, +, -
~, *, +, -
What is a input?
A function that allows us to ask the user to enter some data.
To plug in something.
Data displayed on a screen.
A function
What is a output?
A piece of data that is shown on the screen.
Data that the user enters
An output
A orange
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
people = ["John", "Rob", "Bob"]
print (people[1])
what would this result be?
To display the following on screen
Hello World!
the following command should be used:
print(Hello World!)
print("Hello World!")
print("Hello World" + !)
print"(Hello World!)"
x = 5
y = 6
print(x*y)
The code above displays the following:
11
x*y
Syntax Error
30
x = 5
y = 6
print(x*y)
Select the correct answer(s):
x is a variable
x is a value
print() is a funciton
Everything that we want do display in a print() function must:
be inside parentheses - ()
quotation marks - ""
be inside single quotation marks - ''
be inside hash marks - #
An Operator is:
A person that performs operations
a symbol that specifies the operation to perform
a symbol that means the code will run
a line of code
An Expression is:
A combination of values, operators or functions that can be calculated to give a single value
A printed line of code
A combination of operations that give multiple values
A single value in python
Which operator performs a multiplication?
+
/
X
*
Which operator checks if a value is equal to another value?
+
=
==
!=
Which operator checks if a value is not equal to another value?
==
+=
!=
=
Why did Guido van Rossum call his programming language Python?
He thinks Pythons were cool
He couldn't think of anything else
A friend suggested it
He loves Monty Python
What will:
answer = input("Give me a number")
print(answer * 5)
output?
An error message
The value of answer multiplied by 5
answer * 5
The value of answer repeated 5 times
What does == mean?
Assign a value to a variable
Nothing, it's an error caused by typing == instead of =
Check that the value on the right of the == matches the value on the left
What can a variable not start with?
A special character
A capital letter
A number
A lower case letter
What arithmetic operations does % perform in Python?
Percentage
Floor Division
Remainder
Multiplication
Which of these isn't a Python variable type?
Integer
String
List
Decimal
Which of these is true?
A syntax error will stop a program running
A logic error will stop a program running
A syntax error will let the program run but may have unexpected outcomes
The program will always show an error message for a logic error
What does != represent?
Possibly equal to
Not equal to
Check for error
Don't assign a value
What is the name of the variable in this program?
colour
input
" "
What is the correct programming name of this symbol?
()
brackets
parenthesis
quotation marks
smiley emoji
What is the correct term for this symbol?
" "
Quotation marks
Bunny fingers
Parenthesis
Exclamation mark
What is the correct name for this symbol?
==
Assignment
Equal to
Greater than
Less than
What will this symbol do?
\n
Not
New line
Does nothing
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
print("Hello world!\nHello world!")
Hello world!
