CSE MCQs :: Python MCQs
-
The output of the two codes shown below is the same. State whether this statement is true or false.bin((2**16)-1)'{}'.format(bin((2**16)-1))
-
What is the output of the code shown below?'The {} side {1} {2}'.format('bright', 'of', 'life')
-
In the code shown below, which function is the decorator?def mk(x):def mk1():print("Decorated")x()return mk1def mk2():print("Ordinary")p = mk(mk2)p()
-
What is the output of the code shown below?def f(x):def f1(a, b):print("hello")if b==0:print("NO")returnreturn f(a, b)return f1@fdef f(a, b):return a%bf(4,0)
-
What is the output of the code shown below?def mk(x):def mk1():print("Decorated")x()return mk1def mk2():print("Ordinary")p = mk(mk2)p()
-
What is the result of the expression shown below if x=56.236?
print("%.2f"%x) -
What is the output of the code shown?x=3.3456789'%f | %e | %g' %(x, x, x)
-
The output of the code shown below is:s='{0}, {1}, and {2}'s.format('hello', 'good', 'morning')