1 / 3
Feb 2011

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]
  • created

    Feb '11
  • last reply

    Feb '11
  • 2

    replies

  • 416

    views

  • 2

    users

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...

Suggested Topics

Want to read more? Browse other topics in Python or view latest topics.