WorksheetsBiyani College Day 4
Total questions: 15
Worksheet time: 8mins
Who developed Python Programming Language?
Wick van Rossum
Rasmus Lerdorf
Guido van Rossum
Niene Stom
Which of the following is used to define a block of code in Python language?
Indentation
Key
Brackets
Brackets
Which keyword is used for function in Python language?
Function
Def
Fun
Define
Which of the following character is used to give single-line comments in Python?
//
#
!
/*
What will be the output of the following Python code?
i = 1
while True:
if i%3 == 0:
break
print(i)
i + = 1
1 2 3
error
1 2
none of the mentioned
What is the order of precedence in python?
Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
Parentheses, Exponential, Multiplication, Division, Subtraction, Addition
Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
What are the values of the following Python expressions?
2**(3**2)
(2**3)**2
2**3**2
512, 64, 512
512, 512, 512
64, 512, 64
64, 64, 64
Which of the following functions is a built-in function in python?
a) factorial()
b) print()
c) seed()
d) sqrt()
Which of the following is not a core data type in Python programming?
Tuples
Lists
Class
Dictionary
What will be the output of the following Python expression if x=56.236?
print("%.2f"%x)
56.236
56.23
56.0000
56.24
What will be the output of the following Python function?
len(["hello",2, 4, 6])
Error
6
4
2
What will be the output of the following Python code?
x = 'abcd'
for i in x:
print(i.upper())
a B C D
a b c d
error
A B C D
What will be the output of the following Python statement?
>>>"a"+"bc"
bc
abc
a
bca
What will be the output of the following Python program?
z=set('abc')
z.add('san')
z.update(set(['p', 'q']))
print(z)
{‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’}
{‘abc’, ‘p’, ‘q’, ‘san’}
{‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}
{‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san}
What arithmetic operators cannot be used with strings in Python?
*
+
-
All of the mentioned
