我正在尝试编写代码来执行此操作:
how many 'SOS!' do you want to call? 5
SOS!SOS!SOS!SOS!SOS!
但我能想到的就是这个
print "please tell me how bad your situation is, how many SOS! do you want to call?"
def help(n):
if n <= 0:
print "Don't SOS! if you don't need help!"
elif n > 1:
print "SOS!"
help(n-1)
else:
print "SOS!"
help(input("how many SOS! do you need to call?"))
有没有人有任何解决方案我可以解决这个问题?