wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pyhthon

Total questions: 24

Worksheet time: 41mins

Name
Class
Date
1.

What's the best colour of the alphabet

a)

Tree

b)

Python

c)

Cat

d)

Bush

2.

How old is Steve Jobs

a)

Dead

b)

57

c)

55

d)

56

e)

20

3.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
4.

Is Python case sensitive when dealing with identifiers?

a)

yes

b)

no

5.

What is the maximum possible length of an identifier?

a)

31 characters

b)

59 characters

c)

10 characters

d)

None of the mentioned

6.

Which of the following is invalid?

a)

_a = 1

b)

__a = 1

c)

__str__ = 1

d)

none of the mentioned

7.

Which of the following is an invalid variable?

a)

my_string_1

b)

1st_string

c)

__

8.

Which of the following is not a keyword?

a)

eval

b)

assert

c)

nonlocal

d)

pass

9.

All keywords in Python are in

a)

lower case

b)

UPPER CASE

c)

Capitalized

d)

True, False and None are capitalized while the others are in lower case.

10.

Which of the following is an invalid statement?

a)

abc = 1,000,000

b)

a b c = 1000 2000 3000

c)

a,b,c = 1000, 2000, 3000

d)

a_b_c = 1,000,000

11.

Which of the following cannot be a variable?

a)

__init__

b)

in

c)

it

d)

on

12.

What is the output of this expression, 3*1**3?

a)

27

b)

9

c)

3

d)

1

13.

Which of these in not a core data type?

a)

Lists

b)

Dictionary

c)

Class

14.

Given a function that does not return any value, What value is thrown by default when executed in shell.

a)

int

b)

bool

c)

void

d)

none

15.

Which of the following will run without errors ?

a)

round(45.8)

b)

round(6352.898,2,5)

c)

round()

d)

round(7463.123,2,1)

16.

What is the return type of function id ?

a)

int

b)

float

c)

bool

d)

dict

17.

What error occurs when you execute?

apple = mango

a)

SyntaxError

b)

NameError

c)

ValueError

d)

TypeError

18.

Which of the following results in a SyntaxError ?

a)

‘”Once upon a time…”, she said.’

b)

“He said, ‘Yes!'”

c)

‘3\’

d)

”’That’s okay”’

19.
Un numériseur est ___________-
a)
un périphérique d'entrée
b)
un périphérique de sortie
c)
un périphérique de stockage
20.
Un numériseur est ___________-
a)
un périphérique d'entrée
b)
un périphérique de sortie
c)
un périphérique de stockage
21.
Qu'est-ce qu'un float
a)
Un nombre entier
b)
Un nombre qui n'est pas un nombre entier
c)
Une chaîne de caractère
d)
Une boucle
22.

Which of the following statements is true?

a)

Python is a high level programming language.

b)

Python is an interpreted language.

c)

Python is an object-oriented language.

d)

All of the above.

23.

What is used to define a block of code (body of loop, fuction etc.) in Python?

a)

Curly braces

b)

Parenthesis

c)

Indentation

d)

Quotation

24.

Which of the following is correct?

a)

Comments are for programmers for better understanding of the program.

b)

Python Interpreter ignores comment.

c)

You can write multi-line comments in Python using triple quotes, either ''' or """.

d)

All of the above