Find the output of the following code:
s = "abcdddefgdefg"
x = s.find("def")
print(x)
def make_incrementor(n):
return lambda x: x + n
f = make_incrementor(42)
print(f(1))
What will be the output of the following Python code?
d = {"john":40, "peter":45}
d["john"]
Python multi-line comment is a piece of text enclosed in a ---------- (""")
on each end of the comment.
What will be the output of the following Python code snippet?
x = 'abcd'
for i in range(len(x)):
x[i] = x[i].upper()
print (x)
Can one block of except statements handle multiple exceptions?
Find the output of the following program?
a = 'i'
b = 'd'
c = 'c\\'
d = 'r'
e = 'u'
f = 'i'
g = 'l'
h = 'o\n'
i = 'u'
j = 's'
print d+f+b+a+c+e+g+h+i+j
What will be the output of the python code shown below for various styles of format specifiers?
x=1234
res='integers:...%d...%-6d...%06d' %(x, x, x)
res