Font size
S
M
L
XL
WorksheetsG9-Introduction to Python Selection
Total questions: 6
Worksheet time: 3mins
Name
Class
Date
1.
Used in python to make decisions
a)
If statement
b)
print command
c)
input command
d)
logical operators
2.
What would happen if your forgot to include a colon at the end of an if statement?
a)
Codes works
b)
Syntax error
c)
Logical error
d)
Compilation error
3.
Is the result of the following code :
print(random.randint(3,9))
a)
9
b)
prints the word : random
c)
3
d)
prints a random number between 3 & 9
4.
What is the result of the following code:
fname= "Esslam "
lname= "Fahmi "
print ("Hi" , lname + fname)
a)
Hi Esslam fahmi
b)
Hi Fahmi Esslam
c)
Hi fname lname
d)
Hi there
5.
Are extremely important in the syntax of writing an if statement in python
a)
:
b)
?
c)
indentation
d)
%
6.
You must import the Random library so the random functions can work
a)
True
b)
False
Reset
