wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Unit I_Quizz

Total questions: 40

Worksheet time: 30mins

Name
Class
Date
1.

Python is a ______ language.

a)

Compiled

b)

Low-level

c)

Interpreted

d)

Assembly

2.

Python supports which programming approaches?

a)

Only procedural

b)

Only object-oriented

c)

Structured and object-oriented

d)

Functional only

3.

In Python, everything is treated as a:

a)

Function

b)

Variable

c)

Object

d)

Module

4.

Which property of an object represents its attributes?

a)

State

b)

Behavior

c)

Identity

d)

Method

5.

Which uniquely identifies an object?

a)

Class

b)

State

c)

Behavior

d)

Identity

6.

Which of the following is NOT a common Python data type?

a)

Sequence

b)

Pointer

c)

Numeric

d)

Dictionary

7.

Variables in Python are instances of:

a)

Modules

b)

Classes

c)

Functions

d)

Files

8.

Which numeric data type stores whole numbers?

a)

complex

b)

int

c)

float

d)

bool

9.

Which symbol separates long integers for readability in Python?

a)

,

b)

_

c)

;

d)

:

10.

Which represents scientific notation?

a)

10^6

b)

1*10^6

c)

1e6

d)

1.6

11.

Output of type(3j) is:

a)

int

b)

complex

c)

float

d)

str

12.

Binary numbers in Python are prefixed with:

a)

0d

b)

0b

c)

0o

d)

0x

13.

What is the base of octal numbers?

a)

2

b)

8

c)

7

d)

16

14.

Hexadecimal numbers use which symbols?

a)

0–7

b)

A–Z

c)

0–9, A–F

d)

0–9

15.

Function to convert integer to binary string is:

a)

int()

b)

hex()

c)

oct()

d)

bin()

16.

0XA2 in decimal equals:

a)

160

b)

162

c)

164

d)

166

17.

A float number is accurate up to:

a)

5 decimal places

b)

10 decimal places

c)

15 decimal places

d)

Unlimited

18.

Output of float() with no arguments is:

a)

None

b)

1.0

c)

Error

d)

0.0

19.

Value of 1.23E3 is:

a)

123

b)

1230

c)

12300

d)


12.3

20.

A complex number consists of:

a)

Only real part

b)

Only imaginary part

c)

Real and imaginary parts

d)

Integer and float

21.

complex(5.3) returns:

a)

(0+5.3j)

b)

(5.3+0j)

c)

(5.3+5.3j)

d)

Error

22.

Strings in Python are:

a)

Mutable

b)

Immutable

c)

Numeric

d)

Callable

23.

Negative indexing -1 refers to:

a)

First character

b)

Second character

c)

Middle character

d)

Last character

24.

Lists in Python are:

a)

Immutable

b)

Mutable

c)

Fixed size

d)

Ordered but immutable

25.

Which list operation is valid?

a)

list[2] = value

b)

list(2)

c)

list + int

d)

list / 2

26.

Tuples are:

a)

Mutable

b)

Immutable

c)

Unordered

d)

Changeable

27.

Tuples are written using:

a)

{}

b)

[]

c)

()

d)

||

28.

Default start value of range() is:

a)

1

b)

-1

c)

0

d)

None

29.

range(1,10,2) produces:

a)

Even numbers

b)

Odd numbers

c)

All numbers

d)

Error

30.

Sets are:

a)

Ordered

b)

Indexed

c)

Unordered

d)

Immutable

31.

Sets do NOT allow:

a)

Integers

b)

Strings

c)

Duplicates

d)

Tuples

32.

Method to add a single element to set:

a)

append()

b)

insert()

c)

push()

d)

add()

33.

Method to add multiple elements to a set:

a)

add()

b)

update()

c)

append()

d)

extend()

34.

Frozenset can be used as:

a)

List index

b)

Dictionary key

c)

Set element

d)

File name

35.

How many types of functions exist in Python?

a)

2

b)

3

c)

5

d)

4

36.

Which is a built-in function?

a)

myFunc()

b)

userFunc()

c)

lambda()

d)

len()

37.

bool(0) returns:

a)

True

b)

False

c)

0

d)

Error

38.

Function used to get the type of an object:

a)

id()

b)

isinstance()

c)

vars()

d)

type()

39.

What is the result of the expression 5 > 3 and 2 < 4?

a)

True

b)

False

c)

1

d)

Error

40.

Which operator is used to find the remainder of a division?

a)

//

b)

%

c)

**

d)

/