NEW
Font size
WorksheetsPython Quiz Girls in ICT Day
Total questions: 20
Worksheet time: 3mins
What is the correct file extension for a Python file?
.py
.python
.pt
.txt
Which of these is a valid variable name in Python?
2name
name_2
name-2
name.2
What is the output of: print(3 + 4 * 2)?
14
11
10
8
What is the data type of: "Hello"?
Integer
String
Boolean
List
Which function is used to take input from the user in Python?
read()
input()
scan()
type()
What is the correct way to start a function in Python?
function myFunc()
def myFunc():
create myFunc()
start myFunc():
Which symbol is used to write a comment in Python?
//
#
**
What will be the output of: print(True and False)?
True
False
None
Error
Which Python keyword is used to start a loop?
repeat
loop
for
start
What will this code print? for i in range(3): print(i)
1 2 3
0 1 2
0 1 2 3
1 2
What is the length of this list: mylist = [1, 2, 3, 4]?
3
4
5
Error
What does if do in Python?
Loops code
Defines a function
Makes a decision
Prints output
What is the result of 5 // 2 in Python?
2.5
2
3
2.0
What does len("hello") return?
4
5
6
Error
What will print(10 % 3) output?
1
3
0
10
Which one is a Boolean value in Python?
Yes
true
True
TRUE
What will this code do? name = input("Enter your name:") print(name)
It prints the user’s name
It prints "name"
It gives an error
It prints nothing
Which of these is NOT a data type in Python?
String
Integer
Real
Boolean
What will print(2 == 2) return?
True
False
2
Error
What keyword is used to exit a loop?
exit
stop
end
break
