Font size
WorksheetsCLASS IX PYTHON REVISION
Total questions: 48
Worksheet time: 24mins
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 world!)
Generate the ouput: print (5,"*",4,"=",5*4)
4*5=20
5*4=20
5*4=5*4
error
All keywords in Python are written in _______ letters
capital
small
mixed
any of the above
This is the prompt of the interactive shell of the Python window.
>>>
<<<
///
###
print(3+4)
How do you start writing a for loop in Python?
for each x in y:
for x > y:
for x in y:
Which statement is used to stop a loop?
exit
break
return
stop
What will be the output?
nothing
5
6
an error message
What is the output?
1 2
1
3
5
Which of the following is an invalid variable?
my_string_1
fool
1st_string
cat
The datatype of 134.45 is _________
Int
Float
String
What is the output of the following?
18
31
58
56
What is the output of the following code?
The program executed with errors
[‘Jon’, ‘Kelly’, ‘Scott’, ‘Jessa’]
[‘Jon’, ‘Kelly’, ‘Jessa’, ‘Scott’]
[‘Jon’, ‘Scott’, ‘Kelly’, ‘Jessa’]
What will be the output of the following Python statement?
a
a+bc
bca
abc
The code above displays the following:
11
x*y
Syntax Error
30
If else statement
Outputs a message on the screen
Gets data from the user
A decision
A loop controlled by a decision
What is the output?
True
False
condition1
condition2
What is the output?
next
stop
next
stop
syntax error - program doesn't work
What is the output?
3
3
7
3
5
7
7
What is the output?
True
NIL
True
NIL
True
NIL
NIL
Any statements inside an IF clause (section) can be executed multiple times.
FALSE
TRUE
What would be outputted here?
Bigger than 2!
Number is 5
Bigger than 2!
Number is 5
Nothing
What will be outputted?
number is bigger than 10
nothing
an error
NUMBER IS BIGGER THAN 10
What is the output of the code?
"String"
"No string"
18
none of the above
What is the output?
True
False
condition1
condition2
Given the nested if-else below, what will be the value x when the code is executed successfully.
0
4
2
3
What would be outputted here?
Bigger than 2!
Number is 5
Bigger than 2!
Number is 5
Nothing
This operator checks to see if one value is the same as the other value
==
!=
>
<
What will be outputted?
number is bigger than 10
nothing
an error
NUMBER IS BIGGER THAN 10
What is the output?
3
3
7
3
5
7
7
print("Hello world!\nHello world!")
Hello world!
print("Hello" + str(2) + "world!")
Which statement prints I am 10 years old?
pint("I am 10 years old.")
print('I am 10 years old.)
print('')I am 10 years old.
print("I am 10 years old.")
Which statement prints 7 (Select 2 answers)
print 7
print("7"
print("7")
print(3 + 4)
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
