Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print('Enter integer numbers, enter [.] to end sequence')
- max_negative = -1000000
- x = raw_input('-> ')
- # if '.' or another symbol is inputed in the beginning
- while x == '.' or x.isalpha() or x.isspace():
- x = raw_input('Enter number \n')
- if int(x) < 0:
- max_negative = int(x)
- while x != '.':
- x = raw_input('-> ')
- if not x.isdigit() and not x.isalpha() and not x.isspace():
- x = int(x)
- if x < 0 and x > max_negative:
- max_negative = x
- print('Largest negative number is ' + str(max_negative))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement