Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try:
- value = max(x for x in (float(raw_input('Enter a number: ')) for y in xrange(10)) if x % 2 == 1)
- print 'The highest number was', value
- except ValueError:
- print "There was no odd number or a non-numeric value was entered."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement