Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Biyani College Day 4

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Who developed Python Programming Language?

a)

Wick van Rossum

b)

Rasmus Lerdorf

c)

Guido van Rossum

d)

Niene Stom

2.

Which of the following is used to define a block of code in Python language?

a)

Indentation

b)

Key

c)

Brackets

d)

Brackets

3.

Which keyword is used for function in Python language?

a)

Function

b)

Def

c)

Fun

d)

Define

4.

Which of the following character is used to give single-line comments in Python?

a)

//

b)

#

c)

!

d)

/*

5.

What will be the output of the following Python code?

i = 1

while True:

if i%3 == 0:

break

print(i)

  i + = 1

a)

1 2 3

b)

error

c)

1 2

d)

none of the mentioned

6.

What is the order of precedence in python?

a)

Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

b)

Exponential, Parentheses, Division, Multiplication, Addition, Subtraction

c)

Parentheses, Exponential, Multiplication, Division, Subtraction, Addition

d)

Parentheses, Exponential, Multiplication, Division, Addition, Subtraction

7.

What are the values of the following Python expressions?

2**(3**2)

(2**3)**2

2**3**2

a)

512, 64, 512

b)

512, 512, 512

c)

64, 512, 64

d)

64, 64, 64

8.

Which of the following functions is a built-in function in python?

a)

a) factorial()

b)

b) print()

c)

c) seed()

d)

d) sqrt()

9.

Which of the following is not a core data type in Python programming?

a)

Tuples

b)

Lists

c)

Class

d)

Dictionary

10.

What will be the output of the following Python expression if x=56.236?

print("%.2f"%x)

a)

56.236

b)

56.23

c)

56.0000

d)

56.24

11.

What will be the output of the following Python function?

len(["hello",2, 4, 6])

a)

Error

b)

6

c)

4

d)

2

12.

What will be the output of the following Python code?

x = 'abcd'

for i in x:

print(i.upper())

a)

a B C D

b)

a b c d

c)

error

d)

A B C D

13.

What will be the output of the following Python statement?

>>>"a"+"bc"

a)

bc

b)

abc

c)

a

d)

bca

14.

What will be the output of the following Python program?

z=set('abc')

z.add('san')

z.update(set(['p', 'q']))

print(z)

a)

{‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’}

b)

{‘abc’, ‘p’, ‘q’, ‘san’}

c)

{‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}

d)

{‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san}

15.

What arithmetic operators cannot be used with strings in Python?

a)

*

b)

+

c)

-

d)

All of the mentioned