WorksheetsModel test
Total questions: 40
Worksheet time: 30mins
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
print(3*4+5)
print("Hello world!\nHello world!")
Hello world!
print("Hello" + str(2) + "world!")
What does the following code do? myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
print(Hello world!)
Which one will display when this code is run?
There are 40 students in a classroom. We would like to get all students whose name starts with "A". Which looping is suitable?
For loop
While loop
You are in the car with traffic jammed at a junction. To cross that junction according to the traffic rules, which one is NOT applicable
While loop
Conditional Statement
For loop
You want to sampling 10 from 100 patients (One-by-One). Which one does NOT necessary in your code?
For loop
While loop
Conditional Statement
Set
Given a statement "All swan are white". To falsify this statement, you need to travel around the world and find at least one non-white swan. Which one is a indispensable command in your coding?
For loop
While loop
Conditional statement
Patients visit hospital everyday. You want to count for the "new patients" for each day. Which one is not necessary?
Set
While loop
For loop
Set difference
What is the value of the expression 100 / 25?
4
4.0
"4.0"
'4.0'
Which python operator means 'less than or equal to'?
>=
>
<
<=
What is the answer of this expression, 22 % 3 is?
7
1
0
5
x = 5
print(x > 3 and x < 10)
True
False
x = 8
print(x > 3 or x < 20)
True
False
x = 10
y = 10
print(x != y)
True
False
What is printed by the following statement?
print("P" not in "APCSP")
True
False
Error
