NEW
Font size
WorksheetsPython Basic Test 01
Total questions: 70
Worksheet time: 39mins
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
Is python an interpreter or compiler programming language?
Compiler
Interpreter
Python is uses braces to block off code
True
False
Python uses indentation to block code into chunks
True
False
What output will the console show, if 15 and 30 are entered by the user?
Syntax error
The sum of the two numbers - 45
The concatenation of the two numbers - 1530
Complier error
What result will display in the shell if 15 and 20 is entered by the user?
"num1 + num2"
1520
35
What datatype will the answer be if the user enters 15 and 30?
Integer
String
Boolean
Float
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
What will the output be from the following code?
print(3+4)
3+4
7
SyntaxError
print(3+4)
What would this print?
What will the output be from the following Python code?
Print("Hello world!")
NameError
Hello world!
"Hello world"
Print(Hello world!)
What will the output be from the following Python code?
print(9/3)
3
3.0
9/3
SyntaxError
What will the output be from the following Python code?
print(Hello world!)
Hello world!
SyntaxError
Hello world
print(Hello world!)
Which of these is correct Python conditional statement?
IF answer == "Yes":
if answer == "Yes"
if answer == "Yes":
if answer = "yes":
holds whole numbers
holds a decimal point in a number
If i want to continuously check for a correct answer, what loop would i use?
for loop
while loop
A condition controlled loop is...
A while loop
A for loop
How do you define(assign) variables?
var="String"
func==Hello
var : 123
word= Hello
A line of text that Python won't try to run as code
Integer
Comment
Strings
Input
A data type than can have one of two values: True or False
Boolean
Basic Calculation
For
While
Data type for a whole number
Float
Boolean
Integer
String
A Python data type that holds positive and negative whole numbers
String
int
str
input
The Boolean operator that returns true if EITHER of its operands are true
and
or
not
equal
// means:
two times division
integer division
exact division with floating number
Put a slash
What does symbol % do?
Integer exact division
Percentage
Division
Remainder
What does "\t " make?
Goes to next line
Horizontal space between two strings
Give a title
Add a slash
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
Which type of loop iterates until instructed otherwise?
FOR loop
WHILE loop
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
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
print("3+4")
print(3*4)
print(3*4+5)
print("3*4+5")
print(9/3*2+4-5)
print("Hello" + "world!")
print("Hello" + "world" + "today")
print("Hello" + 2 + "world")
print("Hello world!" * 2)
print("Hello world!\nHello world!")
Hello world!
