Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- You should write [PEP8][1] conformant code. See http://pep8online.com/ to check your code.
- Try
- #!/usr/bin/env python
- numbers = []
- while True:
- inp = raw_input("Enter a number: ")
- if inp == 'done':
- break
- numbers.append(int(inp))
- if len(inp) < 1:
- print("hey")
- break
- try:
- num = float(inp)
- except:
- print("Invalid input")
- continue
- if len(numbers) == 0:
- print("No number entered")
- else:
- print("Maximum is %i" % max(numbers))
- print("Minimum is %i" % min(numbers))
- [1]: https://www.python.org/dev/peps/pep-0008
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement