wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CLASS IX PYTHON REVISION

Total questions: 48

Worksheet time: 24mins

Name
Class
Date
1.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
2.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

3.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
4.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
5.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
6.
What button do you press to compile (run) your program so that it runs in the shell?
a)
F3
b)
F5
c)
F7
d)
F9
7.
What will the output be from the following code?
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
8.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
9.

Generate the ouput: print (5,"*",4,"=",5*4)

a)

4*5=20

b)

5*4=20

c)

5*4=5*4

d)

error

10.

All keywords in Python are written in _______ letters

a)

capital

b)

small

c)

mixed

d)

any of the above

11.

This is the prompt of the interactive shell of the Python window.

a)

>>>

b)

<<<

c)

///

d)

###

12.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
13.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
14.

How do you start writing a for loop in Python?

a)

for each x in y:

b)

for x > y:

c)

for x in y:

15.

Which statement is used to stop a loop?

a)

exit

b)

break

c)

return

d)

stop

16.

What will be the output?

a)

nothing

b)

5

c)

6

d)

an error message

17.

What is the output?

a)

1 2

b)

1

c)

3

d)

5

18.

Which of the following is an invalid variable?

a)

my_string_1

b)

fool

c)

1st_string

d)

cat

19.

The datatype of 134.45 is _________

a)

Int

b)

Float

c)

String

20.

What is the output of the following?

a)

18

b)

31

c)

58

d)

56

21.

What is the output of the following code?

a)

The program executed with errors

b)

[‘Jon’, ‘Kelly’, ‘Scott’, ‘Jessa’]

c)

[‘Jon’, ‘Kelly’, ‘Jessa’, ‘Scott’]

d)

[‘Jon’, ‘Scott’, ‘Kelly’, ‘Jessa’]

22.

What will be the output of the following Python statement?

a)

a

b)

a+bc

c)

bca

d)

abc

23.

The code above displays the following:

a)

11

b)

x*y

c)

Syntax Error

d)

30

24.

If else statement

a)

Outputs a message on the screen

b)

Gets data from the user

c)

A decision

d)

A loop controlled by a decision

25.

What is the output?

a)

True

b)

False

c)

condition1

d)

condition2

26.

What is the output?

a)

next

stop

b)

next

c)

stop

d)

syntax error - program doesn't work

27.

What is the output?

a)

3

b)

3

7

c)

3

5

7

d)

7

28.

What is the output?

a)

True

b)

NIL

c)

True

NIL

d)

True

NIL

NIL

29.

Any statements inside an IF clause (section) can be executed multiple times.

a)

FALSE

b)

TRUE

30.

What would be outputted here?

a)

Bigger than 2!

b)

Number is 5

c)

Bigger than 2!

Number is 5

d)

Nothing

31.

What will be outputted?

a)

number is bigger than 10

b)

nothing

c)

an error

d)

NUMBER IS BIGGER THAN 10

32.

What is the output of the code?

a)

"String"

b)

"No string"

c)

18

d)

none of the above

33.

What is the output?

a)

True

b)

False

c)

condition1

d)

condition2

34.

Given the nested if-else below, what will be the value x when the code is executed successfully.

a)

0

b)

4

c)

2

d)

3

35.

What would be outputted here?

a)

Bigger than 2!

b)

Number is 5

c)

Bigger than 2!

Number is 5

d)

Nothing

36.

This operator checks to see if one value is the same as the other value

a)

==

b)

!=

c)

>

d)

<

37.

What will be outputted?

a)

number is bigger than 10

b)

nothing

c)

an error

d)

NUMBER IS BIGGER THAN 10

38.

What is the output?

a)

3

b)

3

7

c)

3

5

7

d)

7

39.
What will the output be from the following code?
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
40.
What will the output be from the following code?
print("Hello" + str(2) + "world!")
a)
Hello world! Hello world!
b)
Hello2world!
c)
Hello Hello world! world!
d)
SyntaxError
41.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
42.
Python identifies blocks of code by
a)
BEGIN and END keywords
b)
{ and }
c)
aligning up the starts of lines (indentation)
d)
guessing
43.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
44.
Joining elements together to make a string is called what?
a)
Combining
b)
Connecting
c)
Concatenation
d)
Stringing
45.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
46.

Which statement prints I am 10 years old?

a)

pint("I am 10 years old.")

b)

print('I am 10 years old.)

c)

print('')I am 10 years old.

d)

print("I am 10 years old.")

47.

Which statement prints 7 (Select 2 answers)

a)

print 7

b)

print("7"

c)

print("7")

d)

print(3 + 4)

48.

What is the Python built-in function used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command