What is the output from this Python code?
p = 4 #1
q = 5 * p #2
q = p + q #3
print ("@",p, q) #4
p = p - 3 #5
q = q - p #6
print (p, q) #7
Answers
Answered by
2
Answer:
Program 1:
r = lambda q: q * 2
s = lambda q: q * 3
x = 2
x = r(x)
x = s(x)
x = r(x)
print x 0
Program 2:
a = 4.5
b = 2
print a//b
Program 3:
a = True
b = False
c = False
if a or b and c:
print "GEEKSFORGEEKS"
else:
print "geeksforgeeks"
Program 4:
a = True
b = False
c = False
if not a or b:
print 1
elif not a or not b and c:
print 2
elif not a or b or not b and a:
print 3
else:
print 4
Program 5:
count = 1
def doThis():
global count
for i in (1, 2, 3):
count += 1
doThis()
print count
Similar questions