Font size
WorksheetsPython Revision Quiz (Print function, Variable & While Loop)
Total questions: 68
Worksheet time: 48mins
What is the purpose of the input() function?
To declare a variable
To take input from the user
To display output to the user
To end a program
Python is an example of a:
Text-based programming language
Visual-based programming language
Block-based programming language
Language written in JavaScript
What is a program in computer science?
A set of precise instructions
A programming language
A machine that executes instructions
A problem-solving method
Which of the following is a correctly-formatted comment?
&comment
“”Comment””
!comment
#comment
A data type consisting of numbers letters and symbols:
String
Integer
Float
Boolean
What does term ‘debug’ mean:
looking at the code
a set of instructions
Identify errors and fix them
Making a calculation
Which type of loop iterates until instructed otherwise?
FOR loop
WHILE loop
What is the purpose of the print function in Python?
To display text, numbers, or values
To assign values to variables
To receive keyboard input
To calculate values
WHILE loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
A condition is
a statement that is either True or False
a string
an integer
a list
What will the output be from the following code? print (“Hello world!”)
SyntaxError
“Hello world!”
Hello world!
Print (Hello world!)
What does an if statement do?
Close the program
Ask a question
Make a decision
Write a comment
Which kind of loop would be used?
I need a program that will keep letting me add money to a piggy bank until I get to £100.
FOR Loop
WHILE Loop
What does the word "concatenation" mean?
A method of organising data in a database.
Which kind of loop would be used?
I need a program that will keep letting me add a monthly payment for 12 months.
FOR Loop
WHILE Loop
Which of the following is NOT a valid way to concatenate strings in Python?
"Hello" + "World"
"Hello" "World"
"Hello" * "World"
"Hello" + " " + "World"
Which kind of loop would be used?
I need a guessing game program that will let me keep guessing until I get the right answer.
FOR Loop
WHILE Loop
What is the purpose of input() function?
Which kind of loop would be used?
I need a revision program that will run through revision questions 4 times.
FOR Loop
WHILE Loop
Which of the following is a correct way to use the `input()` function to ask for a user's name?
name = input("Enter your name: ")
name = input(Enter your name)
name = input("Enter your name")
name = input(Enter your name: )
Which of the following is an example of Python string?
What is variable?
A variable is a named storage location that can hold data & values.
How do you assign a value to a variable in Python?
Assign values using the '->' operator.
Use the '=' operator to assign a value to a variable.
The correct way to write a variable in python?
my_variables=10
my_variable:10
my variable=10
my_variable is 10
How do you output the content of a variable?
Use a console log statement to display the variable's content.
Assign the variable to another variable to see its content.
Use a print function to display the variable's content.
What happens if you use double quotes around the variable name in the print() statement?
What is the purpose of a "While Loop"?
To perform repeated actions based on a condition.
What does indentation means in python programming?
Indentation refers to the space at the beginning of a line that defines the scope of loops, functions, and conditionals.
What is indentation necessary and important when coding?
In programming, what is iteration?
The repetition of steps within a program
The order in which instructions are carried out
A decision point in a program
Testing a program to make sure it works
FOR loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
Which type of loop iterates until instructed otherwise?
FOR loop
WHILE loop
4
3
2
1
3
2
1
0
4
3
2
1
3
2
1
0
4
3
2
1
3
2
1
0
WHILE loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
A condition is
a statement that is either True or False
a string
an integer
a list
8
6
4
2
Which kind of loop would be used?
I need a program that will keep letting me add money to a piggy bank until I get to £100.
FOR Loop
WHILE Loop
Which kind of loop would be used?
I need a program that will keep letting me add a monthly payment for 12 months.
FOR Loop
WHILE Loop
Which kind of loop would be used?
I need a guessing game program that will let me keep guessing until I get the right answer.
FOR Loop
WHILE Loop
Which kind of loop would be used?
I need a revision program that will run through revision questions 4 times.
FOR Loop
WHILE Loop
What does the word "concatenation" mean?
A method of organising data in a database.
What does the term "string" mean in python?
Which of the following is an example of Python string?
What is variable?
A variable is a named storage location that can hold data & values.
How do you assign a value to a variable in Python?
Assign values using the '->' operator.
Use the '=' operator to assign a value to a variable.
Which is a correct example of variable?
How do you output the content of a variable?
Use a console log statement to display the variable's content.
Assign the variable to another variable to see its content.
Use a print function to display the variable's content.
What is string concatenation?
Why is it important to spell the variable name correctly?
What happens if you use double quotes around the variable name in the print() statement?
What is an integer?
A number
A positive number
A whole number
A number with a decimal part
Which of these is a floating point number?
3
3.0
7
5.6
Which of these is the symbol for divide in python?
÷
/
>
The symbol for multiply is
(a)
