Please help me with this problem..The code runs in my system.....But when i submit i get WA
def life(): a=0 ou=[] i=0 for i in range(5): a=input() ou.append(a) if(a==42): flag=i i=i-1 del ou[i:] ou.sort() i=0 for i in range(len(ou)): print ou[i]
Firstly, you didn't paste your whole code.Secondly, there's no need to sort the input: just output everything up to 42.
ok i wont sort.But thats my complete code...i can get the output for that code...