WorksheetsPython
Total questions: 10
Worksheet time: 5mins
What is the correct file extension for Python files?
.pp
.pt
.py
.pn
What is a correct way to declare a Python variable?
var x = 5
#x = 5
$x = 5
x = 5
x = "John"
# is the same as
x = 'John'
True
False
a = 5
# is the same as
A = 5
True
False
Insert the missing part of the code below to output “SSIT".
__________ (“SSIT")
Type
Write
Which character is used to define a Python comment:
'
//
#
/*
Which is NOT a legal variable name?
my-var = 20
my_var = 20
Myvar = 20
_myvar = 20
Consider the following code:
print('Hello', 'World')
What will be the printed result?
Hello, World
Hello World
HelloWorld
Consider the following code:
a = 'Hello'
b = 'World'
print(a + b)
What will be the printed result?
a + b
Hello World
HelloWorld
Consider the following code:
a = 4
b = 5
print(a + b)
What will be the printed result?
45
9
4 + 5
