Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f=open('input.txt')
- g=open('output.txt','w')
- s=[int(i) for i in f.read().split()]
- s=[i for i in s if (i>0 and i %2 == 0)]
- if s != []:
- print(str(min(s))+' '+str(max(s)), file = g)
- else:
- print('0', file = g)
- f.close()
- g.close()
- f = """1
- 2
- 3
- 4
- -5
- -8"""
- myList = [ i for i in f.split('n') if int(i) > 0 ]
- print("{} {}".format(min(myList), max(myList)) if len(myList)==4 else "0")
- 1 4
- f = """1
- 2
- 3
- -5
- -8"""
- myList = [ i for i in f.split('n') if int(i) > 0 ]
- print("{} {}".format(min(myList), max(myList)) if len(myList)==4 else "0")
- 0
Add Comment
Please, Sign In to add comment