while 1: num = int(raw_input()) if num == 42: break else: print num
;)
Given str1 = "Life, the universe and everything." What does str1.rfind("ve") return? (In Python?)
while 1: num = int(input("Enter Input number : ")) if num==42: break else: print(num)Note : This is the solution for pyton 3+ version
n=[]for i in range(0,100): s=int(raw_input()) if (s!=42): n.append(s) elif (s==42): break print nwhy is this wrong??
4 comments:
;)
Given str1 = "Life, the universe and everything." What does str1.rfind("ve") return? (In Python?)
while 1:
num = int(input("Enter Input number : "))
if num==42:
break
else:
print(num)
Note : This is the solution for pyton 3+ version
n=[]
for i in range(0,100):
s=int(raw_input())
if (s!=42):
n.append(s)
elif (s==42):
break
print n
why is this wrong??
Post a Comment