NEW
Font size
WorksheetsPython Basics
Total questions: 60
Worksheet time: 28mins
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
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!)"
To display something on the screen, use this command:
print()
Print()
screen()
write()
display()
name = 'Dave'
print (name)
Which operator checks if a value is equal to another value?
+
=
==
!=
Which operator checks if a value is not equal to another value?
==
+=
!=
=
Which is the Python logo?
Which of the following would allow the user to enter data?
elif
output
input
Which code would display 'Hello World'
Print("Hello World")
print("Hello World")
print(Hello World)
print=("hello world")
What is a variable?
A named memory location
a value
a number
a letter
Which of the following is NOT a suitable variable name?
num1
Num1
MyName
My name
print("Hello world!")
Which of the following functions display an output to the screen?
display()
output()
print()
post()
What does the following code do?
name = input("what is your name")
says hello
asks for the users DOB
Asks for the users name and stores it in the variable called ,name
Checks information
name = 'Dave'
print (name)
Which of the following symbols means more than?
<
>
==
!=
Which of the following is correct?
if colour==blue
if colour=blue:
if colour=="blue":
if color=blue
Which of these is a variable?
name=input("Welcome to the quiz, what is your name?")
print("Hello",name)
input
name
Hello
What character is added to the end of an if, elif and else statement?
:
#
$
£
The print command is an example of:
Input
Output
Variable
Selection
What is the syntax error in this code?
Incorrect use of variable
Missing : characters at the end of the if and else statements
The code is not indented correctly
Missing brackets
What is the syntax error in this code?
Incorrect use of variable
The code is not indented correctly
Missing : character at the end of the else statement
Missing brackets
What will be the output?
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
greeting 'Dave'
Good morning Dave
Good morning name
Good morning + Dave
A count controlled loop will..
Repeat code until a condition is met
Repeat code a specific amount of times
Repeat code a random amount of times
None of the above
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
What sort of loop is this?
Count Controlled
Condition Controlled
Which of these is NOT a loop in python?
for loop
while loop
nested loop
if loop
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
Instructions carried out one after another in order is a...
List
Sequence
Collection
Series
A named value that can be changed while the program runs is called a...
number
sequence
choice
variable
Which word completes this sentence: "Iteration makes code more ___________"
Complex
Efficient
Simple
Straightforward
A FOR loop is....
A COUNT controlled loop
A CONDITION controlled loop
A WHILE loop is....
A COUNT controlled loop
A CONDITION controlled loop
