NEW
Font size
WorksheetsKODEKIDDO HACK #MLH3
Total questions: 10
Worksheet time: 5mins
What is the correct syntax to create loop in Python?
For i in range(10) print i
For i in range (10): print i
For i in range (10) print i
For i in range 1-10: print i
What is the output of the following code?
var1 = 1
var2 = 2
var3 = "3"
print(var + var2 + var3)
6
88
123
Error. Mixing operators between numbers and strings are not supported
What is a correct syntax to output "Hello World" in Python?
echo ("Hello World")
print ("Hello World")
p ("Hello World")
print Hello World
How do you insert COMMENTS in Python code?
//This is a comment
#This is a comment
/* This is a comment */
*/ This is a comment/*
Which one is NOT a legal variable name?
_myVar
my_var
Myvar
my-var
What is the correct file extension for Python files?
.py
.pyth
.pt
.pyt
What is the correct way to create a function in Python?
def myFunction():
create myFunction():
function myFunction():
loop myFunction():
Which operator is used to multiply numbers?
#
*
X
%
Which of these collections defines a LIST?
{"apple", "cherry", "banana"}
["apple", "cherry", "banana"]
("apple", "cherry", "banana")
{name : "apple" , color : "red"}
Which statement is used to stop a loop?
break
stop
return
exit
