probiner

Untitled

Oct 11th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. #The largest odd number of three variables.
  2.  
  3. import random
  4.  
  5. x=str(random.randint(0, 100))
  6. y=str(random.randint(0, 100))
  7. z=str(random.randint(0, 100))
  8. #print(x,y,z) #uncomment to check the variables.
  9. if int(x)%2==0:
  10.     x=''
  11. if int(y)%2==0:
  12.     y=''
  13. if int(z)%2==0:
  14.     z=''
  15. if x+y+z == '':
  16.     print('all numbers are even')
  17. else:
  18.     print (max (x,y,z))
Advertisement
Add Comment
Please, Sign In to add comment