WorksheetsPlay with Python
Total questions: 52
Worksheet time: 1hrs 25mins
What is the result of the expression if x=15 and y=12:
b1101
0b1101
12
15
Which of the following represents the bitwise XOR operator?
&
^
|
!
What is the value of the following expression?
2+4.00, 2**4.0
(6.0, 16.0)
(6.00, 16.00)
(6, 16)
(6.00, 16.0)
Which of the following will run without errors ?
round(45.8)
round(6352.898,2,5)
round()
round(7463.123,2,1)
What is the reason you think that cost the test series vs kiwis?
VK Captaincy
Boom Boom current form
Regular Opener's Injury
Collective Failure
What dataype is the object below ? L = [1, 23, ‘hello’, 1].
List
Sets
dictionary
Tuple
What is the maximum possible length of an identifier?
31 characters
63 characters
79 characters
None of the above
Which of the following is an invalid statement?
abc = 1,000,000
a b c = 1000 2000 3000
a,b,c = 1000, 2000, 3000
a_b_c = 1,000,000
How is our python class ?
Except subject matter, we are learning everything
It's a fair balance between both inside and outside subject matter.
Feel like bunking always
Wait....are you teaching python for us ????
What is the output when following code is executed ?
print r"\nhello"
The output is
a new line and hello
\nhello
the letter r and then hello
Error
What is the output of the following code ?
example = "snow world"
example[3] = 's'
print example
snow
snow world
Error
snos world
What is the output of “hello”+1+2+3 ?
hello123
hello
Error
hello6
What is the output of the following?
print('The sum of {0} and {1} is {2}'.format(2, 10, 12))
The sum of 2 and 10 is 12
Error
The sum of 0 and 1 is 2
None above
How many keyword arguments can be passed to a function in a single function call?
zero
one
zero or more
one or more
What is the output of the code shown below?
def f1():
x=100
print(x)
x=+1
f1()
Error
100`
101
99
On assigning a value to a variable inside a function, it automatically becomes a global variable. State whether true or false.
True
False
Error
None mentioned
Which of these is false about recursion?
Recursive function can be replaced by a non-recursive function
Recursive functions usually take more memory space than non-recursive function
Recursive functions run faster than non-recursive function
Recursion makes programs easier to understand
One change that u want me to make up ?
Better give more marks, irrespective of what we write
Try to Speak more in telugu rather english
Please stop all additional stories and deliver only python
Be as you are now
What is the output of the code shown below?
l1=[1, 2, 3, [4]]
l2=list(l1)
id(l1)==id(l2)
True
False
Error
Address of l1
Which of the following statements is used to create an empty set?
{ }
set()
[ ]
( )
What is the output of the line of code shown below, if s=set([1, 2, 3]), s1= {1, 2, 3}?
s1.issubset(s1)
True
Error
No output
False
What will be the output?
d = {"john":40, "peter":45}
d["john"]
40
45
"john"
"peter"
What is the output of the following piece of code when executed in Python shell?
a=("Check")*3
a
(‘Check’,’Check’,’Check’)
* Operator not valid for tuples
(‘CheckCheckCheck’)
Syntax error
Is the following piece of code valid?
a=2,3,4,5
a
Yes, 2 is printed
Yes, [2,3,4,5] is printed
No, too many values to unpack
Yes, (2,3,4,5) is printed
What is the output of the following?
i = 2
while True:
if i%3 == 0:
break
print(i)
i += 2
2 4 6 8 10 …
2 4
2 3
error
I'm giving you another chance to change your dept. Which one do you choose ?
In all birth,ECE only.
May be I'll go with CSE and join with u
This time why not Civil / Mech
I will run as fast as I can to escape from engineering itself
What is the output of the following?
x = "abcdef"
i = "a"
while i in x:
x = x[:-1]
print(i, end = " ")
i i i i i i
a a a a a a
a a a a a
none of the mentioned
What is the output of the following?
x = "abcdef"
i = "i"
while i in x:
print(i, end=" ")
no output
i i i i i i …
a b c d e f
abcdef
What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
print(x)
0 1 2
a b c
0 a 1 b 2 c
none of the mentioned
What is the output of the following?
string = "my name is x"
for i in string.split():
print (i, end=", ")
m, y, , n, a, m, e, , i, s, , x,
m, y, , n, a, m, e, , i, s, , x
my, name, is, x
error
Whom do u think will clinch IPL2020 trophy?
MI
CSK
SRH
RCB
Others
What is the output of the following?
a = [0, 1, 2, 3]
for a[0] in a:
print(a[0])
0 1 2 3
0 1 2 2
3 3 3 3
error
What is the output of the following snippet of code?
total={}
def insert(items):
if items in total:
total[items] += 1
else:
total[items] = 1
insert('Apple')
insert('Ball')
insert('Apple')
print (len(total))
3
1
2
0
What is the output of the following code?
a={}
a[2]=1
a[1]=[2,3,4]
print(a[1][1])
[2,3,4]
3
2
An exception is thrown
What is called when a function is defined inside a class?
Module
Class
Another function
Method
What is the output of below program?
def f(x, y, z): return x + y + z
f(2, 30, 400)
432
24000
430
No output
What is the output of the following piece of code?
def a(b):
b = b + [5]
c = [1, 2, 3, 4]
a(c)
print(len(c))
4
5
1
An exception is thrown
What is the output of the code shown below?
'The {} side {1} {2}'.format('bright', 'of', 'life')
Error
‘The bright side of life’
‘The {bright} side {of} {life}’
No output
Do u really want me to come again in upcoming semesters ?
What the hell, no wayyyyyyy
If possible, yes please
If your'e coming again, i'm discontinuing from vardhaman for sure
It doesn't bother me whether u come or not, who cares ?
What is the output for −
'you are doing well' [2:999]
'you are doing well'
' '
Index error
'u are doing well'
a = 0
while a<10:
… print(''you are learning python'')
… pass
9
10
11
Infinity
What is output for − min(''hello world'')
e
a blank space character
w
None of the above
Suppose we are given with two sets(s1&s2) then what is the output of the code −
S1 + S2
Adds the elements of the both the sets.
Removes the repeating elements and adds both the sets.
It is an illegal command.
Output will be stored in S1.
Output:
i = 1
while True:
if i%3 == 0:
break
print(i)
i + = 1
1 2
1 2 3
error
none
What will be the output of the following Python code?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1
1 2 3 4 5 6
1 2 3 4 5 6 7
Error
1 2 3 4 5 6 1 2 3 4 5 6
What will be the output of the following Python code?
i = 5
while True:
if i%0O11 == 0:
break
print(i)
i += 1
5 6 7 8 9 10
5 6 7 8
5 6
error
7. What will be the output of the following Python code?
i = 1
while True:
if i%2 == 0:
break
print(i)
i += 2
1
1 2
1 2 3 4 5 6 …
1 3 5 7 9 11 …
What will be the output of the following Python code?
i = 2
while True:
if i%3 == 0:
break
print(i)
i += 2
2 4 6 8 10 …
2 4
2 3
error
What will be the output of the following Python code?
i = 1
while False:
if i%2 == 0:
break
print(i)
i += 2
1
1 3 5 7 …
1 2 3 4 …
none
What will be the output of the following Python code?
True = False
while True:
print(True)
break
True
False
Error
True = False
How you answered all the questions?
Genuinely
Inky...pinky....ponky.....
A friend in need is a friend indeed
Based on my lucky number
On the whole, How is this quiz assignment ?
You saved us from writing..just for that its good
Bit interesting..we ll stick to this
Enough of this sir, Can I get some A4 sheets ???
A good time pass thts it
