WorksheetsPython Basics v1.0 ( Medvedev School )
Total questions: 30
Worksheet time: 18mins
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
Python is _____ sensitive which means you must use the same indentation every time.
space
colour
code
word
print(3*4+5)
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
Which one will display when this code is run?
print("Hello" + str(2) + "world!")
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
print(Hello world!)
people = ["John", "Rob", "Bob"]
print (people[1])
what would this result be?
people = ["John", "Rob", "Bob"]
print (people[-1])
what would this result be?
people = ["John", "Rob", "Bob"]
print (people[4])
what would this result be?
Choose the correct Python keywords
if
why not
else
elseif
maybe
