wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python programming fundamentals

Total questions: 22

Worksheet time: 11mins

Name
Class
Date
1.

Which of the following are the fundamental building blocks of a python program?

a)

identifiers

b)

constants

c)

punctuators

d)

tokens

2.

Identifier name cannot be composed of special characters other than _______________

a)

underscore(_)

b)

&

c)

$

d)

#

3.

Python takes __________ indented spaces after the function declaration statement by default.

a)

5

b)

6

c)

4

d)

1

4.

Single line comments in python begin with ___________ symbol.

a)

#

b)

"

c)

'''

d)

%

5.

Which of the following does not represent a complex number?

a)

K=2+3j

b)

K=complex(2,3)

c)

k=2+3i

d)

K=4+5j

6.

What is the order of precendence of arithmetic operators given below in python?

1. Paranthesis 2.Exponential 3.Multiplication 4. Division 5. Addition 6.Subtraction

a)

1,2,3,4,5,6

b)

2,3,4,5,6,1

c)

1,3,2,6,4,5

d)

4,6,5,2,3,1

7.

What will be the output of the following code?

x,y=2,6

x,y=y,x+2

print(x,y)

a)

6 6

b)

4 4

c)

4 6

d)

6 4

8.

The extension of a python file is given as

a)

.pt

b)

.pwy

c)

.py or .pyw

d)

.yppy

9.

The reserved words used in python interpreter to recognize the structure of a program is termed as __________

a)

identifiers

b)

tokens

c)

literals

d)

keywords

10.

Which of the following operator is used for floor divivsion?

a)

*

b)

/

c)

**

d)

//

11.

Which of the following is a valid statement?

a)

a=b=c=20,60

b)

a,b,c=10,20,30

c)

a b c = 10 20 30

d)

a_b_c=20

12.

Python supports unicode coding standard

a)

True

b)

False

13.

AN identifier must be a keyword of python

a)

True

b)

False

14.

Integers and strings are immutable data types

a)

True

b)

False

15.

3+a=c is a valid statement

a)

True

b)

False

16.

The input() always returns a value of an integer type

a)

True

b)

False

17.

The print() without any value or name or expression prints a blank line

a)

True

b)

False

18.

In python, boolean type is a sub type of integer

a)

True

b)

False

19.

"AISSCE- 2020" is a valid string variable in python

a)

True

b)

False

20.

In python, integer data type has a fractional part

a)

True

b)

false

21.

None literal in python means "there is nothing here"

a)

True

b)

False

22.

Python supports multiple assignments to multiple variables

a)

True

b)

False