wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Assesment 1

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

What is the primary purpose of Python in real-world applications?

a)

Data analysis

b)

Web development

c)

Game development

d)

All of the above

2.

Which of the following is a basic data type in Python?

a)

Tuple

b)

String

c)

Dictionary

d)

List

3.

What does the 'if' statement do in Python?

a)

Declares a variable

b)

Executes a block of code based on a condition

c)

Repeats a block of code

d)

Defines a function

4.

Which operator is used for comparison in Python?

a)

||

b)

&&

c)

==

d)

+

5.

What is the output of the expression print((5+2)*5 + 3)?

a)

54

b)

38

c)

56

d)

15

6.

How do you create a list in Python?

a)

()

b)

lst()

c)

{}

d)

[]

7.

Which of the following is NOT a logical operator in Python?

a)

not

b)

or

c)

xor

d)

and

8.

What is the purpose of a loop in programming?

a)

To compare values

b)

To define a variable

c)

To execute a block of code multiple times

d)

To create a function

9.

Which of the following is a valid way to declare a variable in Python?

a)

x := 10

b)

10 = x

c)

var x = 10

d)

x = 10

10.

What will be the output of the following code: print(2 * 3 + 1)?

a)

7

b)

6

c)

8

d)

5

11.

Which of the following statements is used for decision-making in Python?

a)

loop

b)

if

c)

for

d)

while

12.

What is the purpose of the 'elif' statement?

a)

To declare a variable

b)

To create a loop

c)

To define a function

d)

To handle multiple conditions

13.

What is the output of the expression 'Hello+World'?

a)

Hello+World

b)

HelloWorld

c)

Error

d)

Hello World

14.

What will be the output of the following code: print(10 > 5 and 5 < 3)?

a)

None

b)

Error

c)

True

d)

False

15.

Which of the following is a valid list declaration?

a)

my_list = [1, 2, 3]

b)

my_list = {1, 2, 3}

c)

my_list = (1, 2, 3)

d)

my_list = 1, 2, 3

16.

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

a)

String

b)

Integer

c)

Float

d)

Character

17.

What is the result of the expression 10 == 10?

a)

True

b)

False

c)

None

d)

Error

18.

How do you define a list with mixed data types?

a)

my_list = [1, 'two', 3.0]

b)

my_list = (1, 'two', 3.0)

c)

my_list = {1, 'two', 3.0}

d)

my_list = 1, 'two', 3.0

19.

What is the purpose of the 'pass' statement in Python?

a)

To create a loop

b)

To define a function

c)

To skip a block of code

d)

To exit a loop

20.

What will be the output of the following code: print('A' in 'abcdefghAijklmno')?

a)

Error

b)

False

c)

None

d)

True

21.

Who is the founder of Python programming language

a)

Dennis Ritchie

b)

James Arthur Gosling

c)

Guido van Rossum

d)

Bjarne Stroustrup

22.

Which statement is true about elif?

a)

elif can only be used once

b)

elif is optional

c)

elif ends the program

23.

What will be printed?

a)

Hi

b)

Hello

c)

Bye

d)

Error

24.

What is the output?

a)

Greater

b)

Equal

c)

Smaller

d)

Error

25.

Which of these is the correct way to convert a string s to uppercase?

a)

upper(s)

b)

s.uppercase()

c)

s.upper()

d)

uppercase(s)