NEW
Font size
WorksheetsPython
Total questions: 40
Worksheet time: 28mins
print("Hello world!\nHello world!")
Hello world!
Code executed based on a condition being true
Sequence
Condition
Iteration
Variable
What does the following code do?
myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
What is Python named after
The snake
Television show called Monty Python
Surname of the creator
Combination of names of the creators
print(Hello world!)
Used to create a function
const
int
def
while
What does the term 'debug' mean?
Identify errors and fix them
Making a calculation
A set of instructions
Looking at code
If you want more than one option for your code, what do you use (after if)?
elif
else
ifif
else if
What would this result be?
people = ["John", "Rob", "Bob"]
print (people[1])
John
Rob
Bob
What does the print function do in python?
It's a variable
It can input data
It displays something like a string or integer
It loops the code
What is the code for a STRING in python?
str
stri
stg
What is correct code for INTEGER in python?
in
ing
int
I am 71 years old! What will the output be?:
IF you are 70 or older, say “You are aged to perfection!”
ELIF you are exactly 50, say “Wow, you are half a century old!”
ELSE say “You are a spring chicken!”
“You are aged to perfection!”
"Wow, you are half a century old!"
"You are a spring chicken!"
I am 18 years old! What will the output be?:
IF you are 70 or older, say “You are aged to perfection!”
ELIF you are exactly 50, say “Wow, you are half a century old!”
ELSE say “You are a spring chicken!”
"You are aged to perfection"
"Wow, you are half a century old!"
"You are spring chicken!"
Look at this code, how many times will it loop?
3
1
0
4
Used to structure code in Python
Whitespace
Comments
Booleans
Variables
a data type than can have one of two values: True or False
Boolean
Variable
Modulo
Interpreter
What will the output be from the following code?
print( 3 + 4 )
3 + 4
7
SyntaxError
print( 3 + 4 )
