71. What will be the output of the following Python code?
'%s' %((1.23,),)
'%s' %((1.23,),)
72. What is the primary purpose of the functools.partial function in Python?
73. Which of the following is used to format a string with left-aligned text within a field?
74. What will be the output of the following Python expression if x=456?
print("%-06d"%x)
print("%-06d"%x)
75. What will be the output of the following Python code?
def f(x):
def f1(*args, **kwargs):
print("*", 5)
x(*args, **kwargs)
print("*", 5)
return f1
@f
def p(m):
p(m)
print("hello")
def f(x):
def f1(*args, **kwargs):
print("*", 5)
x(*args, **kwargs)
print("*", 5)
return f1
@f
def p(m):
p(m)
print("hello")
76. What will be the output of the following Python code?
def f(x):
def f1(*args, **kwargs):
print("*"* 5)
x(*args, **kwargs)
print("*"* 5)
return f1
def a(x):
def f1(*args, **kwargs):
print("%"* 5)
x(*args, **kwargs)
print("%"* 5)
return f1
@f
@a
def p(m):
print(m)
p("hello")
def f(x):
def f1(*args, **kwargs):
print("*"* 5)
x(*args, **kwargs)
print("*"* 5)
return f1
def a(x):
def f1(*args, **kwargs):
print("%"* 5)
x(*args, **kwargs)
print("%"* 5)
return f1
@f
@a
def p(m):
print(m)
p("hello")
77. What will be the output of the following Python code?
'The {} side {1} {2}'.format('bright', 'of', 'life')
'The {} side {1} {2}'.format('bright', 'of', 'life')
78. What will be the output of the following Python code snippet?
a='hello'
q=10
vars()
a='hello'
q=10
vars()