Type of Approach used in Python?
What is the output of the following program:
print "Abekus"[::-1]
Find the output of the following code:
l1=[1,2,3,4]
l2=[2,3,4,5]
l3=l1+l2
print(l3[2])
What is the value of the following expression?
8/4/2, 8/(4/2)
Consider a list mano with elements ['abc','abcde']. What is the output of following.
print(mano[-1][-2])
What will be the output of the following Python code?
a = {5, 4}
b = {1, 2, 4, 5}
print(a < b)
Deduce the output of the following code:
x="10010"
y=""
for i in x:
if i=="0":
y+="1"
else:
y+="0"
print(y)
Deduce the output of the following code:
def fun(a,b):
if b==0:
return 1
else:
return a*fun(a,b-1)
print(fun(2,2))
from functools import reduce
f = lambda a,b: a if (a > b) else b
num = reduce(f, [47,11,42,102,13])
print (num)
def f(number):
# Missing function body
print(f(5))
OnSite
1 Openings
FullTime
Posted 17 days ago