wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pyhon module 1

Total questions: 32

Worksheet time: 17mins

Name
Class
Date
1.

Is python compiled language ?

a)

Yes

b)

No

c)

No Idea

2.

What will be the output of :

a = 4.5

b = 2

print( a//b )

a)

2.0

b)

2.5

c)

2.25

d)

Error

3.

What command is used to insert 6 in a list "L" at 3rd position?

a)

L.insert(3,6)

b)

L.add(3,6)

c)

L.insert(2,6)

d)

L.append(2,6)

4.

list = 5*[0]+5*[10]

What is the output of this?

a)

Error

b)

[0,0,0,0,0,10,10,10,10,10]

c)

[50]

d)

[5,50]

5.
Code executed based on a condition being true
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
6.
Code repeated / looped until a condition has been met or a set number of times.
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
7.
What is python named after
a)
The snake
b)
Television show called Monty Python
8.
Python identifies blocks of code by
a)
BEGIN and END keywords
b)
{ and }
c)
aligning up the starts of lines (indentation)
d)
guessing
9.
Joining elements together to make a string is called what?
a)
Combining
b)
Connecting
c)
Concatenation
d)
Stringing
10.
If you want more than one option for your code, what do you use (after if)?
a)
elif
b)
else
c)
ifif
11.

Which of the following types of computer languages uses binary code to communicate with the computer?

a)

High-level languages

b)

Assembly languages

c)

Machine language

d)

Database languages

12.

What are the names of the two types of mode that are used in Python? Select two.

a)

Interactive mode

b)

Scratch mode

c)

Imperial mode

d)

Script mode

13.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
14.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
15.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
16.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
17.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
18.

if we only import the module then we need to use the function like -

a)

function

b)

module.function()

c)

both

d)

none

19.

Which python data type is mutable is nature ?

a)

list

b)

tuple

c)

int

d)

string

20.

Which of the following operator is used to compare operator -

a)

!=

b)

<=

c)

==

d)

all of the above

21.

Which of the following is known as the bitwise operator -

a)

and

b)

&

c)

==

d)

none

22.

Is python an interpreter or compiler programming language?

a)

Compiler

b)

Interpreter

23.

Which one will display when this code is run?

a)
b)
c)
d)
24.
Returns the remainder from division
a)
modulus
b)
exponents
c)
boolean
d)
variables
25.
Surrounds multi-line comments
a)
"""
b)
**
c)
#
d)
%
26.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
27.

Which operator is used in python to import all modules from packages?

a)

. operator

b)

* operator

c)

-> symbol

d)

, operator

28.

Each item in a list has an index. What is the first index in a Python list?

a)

0

b)

1

c)

a

d)

A

29.

What is the Python built-in function to converts a number to a string?

a)

str()

b)

int()

c)

parseInt()

d)

convert

30.
What will the output be from the following code?
print("Hello" + "world" + "today")
a)
Helloworldtoday
b)
Hello world today
c)
"Hello" "world" "today"
d)
SyntaxError
31.

What will the output be from the following code?

print Hello world!

a)

Hello world!

b)

SyntaxError

c)

Hello world

d)

print Hello world!

32.
The character that must be at the end of the line for if, while, for etc.
a)
:
b)
;
c)
.
d)
,