NEW
Font size
WorksheetsPC1.8 Evaluate computer program
Total questions: 10
Worksheet time: 20mins
How many variables in the codes below?
score=int(input("Enter the score? "))
a=200
total=a+100
1
2
3
4
What is the data type in the score's variable?
score=int(input("Enter the score? "))
Integer
Float
Character
String
What is the data type in the score's variable?
score=input("Enter the score? ")
Integer
Float
Character
String
What is the output in the codes below?
a=10
b=20
print(a!=b)
10
False
True
20
if total>=50 :
print("A")
else :
print("B")
Will the code inside the if block is executed or skipped when total = 50?
(if block) will not be executed, then print "B"
(if block) will be executed, then print "A"
(if block) will be executed, then print "B"
(if block) will not be executed, then print "A"
The codes below have an error because of :
score=90
if score>100 :
else :
print("B")
No parentheses after if statement
No print function after if statement
No columns
No semicolons
The codes below have an error because of :
if score>100 :
print("A")
else :
print("B")
No indent
No print function
No columns
No variables
The codes below have an error because of :
score==30
if score>100 :
print("A")
else :
print("B")
The arithmetic operator in the variable score
No print function
Relational operator in the variable score
No variables
The codes below have an error because of :
score=150
if score>100
print("A")
else
print("B")
The arithmetic operator in the variable score
No print function
Relational operator in the variable score
No colons
a=100
b=50
print((a>b) and (a==b))
The data type after the codes have been executed will be:
Integer
String
Float
Boolean
