import re
How many lines does the following code prints.
x="Hello World."
for i in x:
print(i)
x = ['ab', 'cd']
print(list(map(len, x)))
What will be the output of the following Python code?
lst=[[1,2],[3,4]]
print(sum(lst,[]))
What will be the output of the following code?
if 2 & 4:
print("Easy")
else:
print("Peasy")
What is the output of the following program?
def Foo(x):
if (x==1):
return 1
else:
return x+Foo(x-1)
print(Foo(4))
Write a list comprehension for number and its cube for:
l=[1, 2, 3, 4, 5, 6, 7, 8, 9]
What will be the output of the following Python code?
def f(i, values = []):
values.append(i)
return values
f(1)
f(2)
v = f(3)
print(v)
What is the relationship between the variables lst
and num
in the following code?
lst = [1, 2, 3, 4]
num = lst
Find the output of the following code:
def minimum(x, y, z):
def findmin(x, y, z):
x = min(x, y, z)
return x
return findmin
z = minimum(11, 15, 8)
print(z(20, 35, 25))