NEW
Font size
WorksheetsPython 02
Total questions: 15
Worksheet time: 11mins
#What is the difference between randint and randrange ?
randint(0,5)
randrange(0,5)
randint randomize from 0,1,2,3,4,5
randrange randomize from 0,1,2,3,4
both are correct
both are incorrect
What button do you press to compile (run) your program so that it runs in the shell?
F5
F3
F8
F9
choice(list) do?
Randomize a set of numbers
Randomize a list
Randomize a letters of a string
All answers are correct
#What is the output?
nothing
hallo
Error
HALLO
#The word "SECRET" is entered but code does not work? What must be placed at (*)?
.lower()
.upper()
.capitalize()
.title()
Everytime you want to use random. What must you first do?
import the random module
random var must be initialized
None of these answers
random list must be initialized
#What is the output?
yes
no
Error
Nothing
#In turtle, what is the short way to write forward, backward, right, left?
fd, bk, rt, lt
f, b, r, l
None of these
fo, ba, ri, le
#How do you define a string?
string = " "
string = 0
string = { }
string = [ ]
#How do you define an integer?
integer = " "
integer = 0
integer = { }
integer = [ ]
#How do you define a list?
myList = " "
myList = o
myList = [ ]
myList = { }
a <= b
a is less than b
a is less than or equal to b
a is more than b
a is more than or equal to b
a >= b
a is greater than b
a is greater or equal to b
a is less than b
a is less than or equal to b
#What will be printed?
name = int(input("Enter your name "))
print(name)
The name you have entered
Error
#What is the output?
prints "Hi" 5 times
calls say() 1 time
Error
print "Hi" 1 time
