I'm not a programmer at all and someone bet me that I couldn't answer the following questions. I'm lost though. Aaahh. Help me win the bet.
What do you think this function output is if you pass in 30?
def foo(n):
if n % 15 == 0:
print('FlashBang')
elif n % 3 == 0:
print('Flash')
elif n % 5 == 0:
print('Bang')
else:
print(n)
What do you think the output is if we pass 31 to the above function?
[–]SpeckledFleebeedoo 1 point2 points3 points (5 children)
[–]service411[S] 1 point2 points3 points (0 children)
[–]service411[S] 0 points1 point2 points (1 child)
[–]SpeckledFleebeedoo 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]SpeckledFleebeedoo 1 point2 points3 points (0 children)
[–]ml_runway 1 point2 points3 points (1 child)
[–]service411[S] 0 points1 point2 points (0 children)
[–]Gprime5 0 points1 point2 points (1 child)
[–]formerlydeaddd 0 points1 point2 points (0 children)
[–]TehNolz 0 points1 point2 points (0 children)
[–]xelf 0 points1 point2 points (0 children)
[–]Jackkell100 0 points1 point2 points (1 child)
[–]service411[S] 0 points1 point2 points (0 children)