Select an option to see the answer and solution.
Formatting and Decorators
practice.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
82
Questions
1/5
Page
Pick an option on a question to see the right answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
print("%5.2f"%x)Select an option to see the answer and solution.
print("-%5d0",989)Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')Select an option to see the answer and solution.
'%x %d' %(255, 255)Select an option to see the answer and solution.
class A:
@staticmethod
def a(x):
print(x)
A.a(100)Select an option to see the answer and solution.
Select an option to see the answer and solution.
def f(x):
def f1(a, b):
print("hello")
if b==0:
print("NO")
return
return f(a, b)
return f1
@f
def f(a, b):
return a%b
f(4,0)Select an option to see the answer and solution.
Select an option to see the answer and solution.
def f(x):
def f1(*args, **kwargs):
print("Examveda")
return x(*args, **kwargs)
return f1Select an option to see the answer and solution.
i. '{0}'.format(4.56)
ii. '{0}'.format([4.56,])Select an option to see the answer and solution.
Select an option to see the answer and solution.
print(“%06d”%X)Select an option to see the answer and solution.
l=list('HELLO')
p=l[0], l[-1], l[1:3]
'a={0}, b={1}, c={2}'.format(*p)Select an option to see the answer and solution.
def mk(x):
def mk1():
print("Decorated")
x()
return mk1
def mk2():
print("Ordinary")
p = mk(mk2)
p()Select an option to see the answer and solution.
x=3.3456789
'%s' %x, str(x)Select an option to see the answer and solution.