wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PYTHON UNIT I MCQS

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which of the following is a feature of Python?

a)

Strongly typed language

b)

Static typing

c)

Interpreted language

d)

Compiler-based language

2.

How do you run a Python script from the command line?

a)

python script.py

b)
c)

execute script.py

d)

start script.py

3.

Which of the following is a valid identifier in Python?

a)

1variable

b)

variable_1

c)

global

d)

break

4.

Which of the following is a reserved keyword in Python?

a)

for

b)

while

c)

if

d)

all of the above

5.

How do you define a variable in Python?

a)

var x = 5

b)

x = 5

c)

int x = 5

d)

variable x = 5

6.

What is the purpose of comments in Python?

a)

They are used to improve the performance of the code.

b)

They are used to make the code run faster.

c)

They are used to explain the code and make it more readable.

d)

They are used to add extra functionality to the code.

7.

Which symbol is used for indentation in Python?

a)

Spaces

b)

Tabs

c)

Both spaces and tabs

d)

None of the above

8.

How do you write a multi-line statement in Python?

a)

Separate each line with a comma (,)

b)

Use the backslash (\) at the end of each line

c)

Enclose the statement in triple quotes (""")

d)

Use a semicolon (;) at the end of each line

9.

What is a suite in Python?

a)

A group of multiple statements within a loop or a function

b)

A Python module containing multiple functions

c)

A group of reserved keywords in Python

d)

A data type for storing multiple values

10.

Which type of quotes can be used to define a string in Python?

a)

Single quotes ('')

b)

Double quotes ("")

c)

Both single and double quotes

d)

None of the above

11.

How do you take user input in Python?

a)

input()

b)

get_input()

c)

user_input()

d)

read()

12.

Which function is used to print output in Python?

a)

print()

b)

output()

c)

display()

d)

show()

13.

Which operator is used for exponentiation in Python?

a)

^

b)

*

c)

%

d)

**

14.

Which data type is used to store a sequence of characters in Python?

a)

Integer

b)

Float

c)

String

d)

Boolean

15.

How do you convert a string to an integer in Python?

a)

str()

b)

int()

c)

float()

d)

bool()