Advertisement
Talithacelin

Ordering numbers

Sep 19th, 2022 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. def biggest_num (a, b, c):
  2.   if a > b and a > c:
  3.     return a
  4.   elif b > a and b > c:
  5.     return b
  6.  
  7.   return c
  8.  
  9. def smallest_num (a, b, c):
  10.   if a < b and a < c:
  11.     return a
  12.   elif b < a and b < c:
  13.     return b
  14.   else:
  15.     return c
  16.  
  17. def middle_num (a, b, c):
  18.   if (b > a > c) or (c > a > b):
  19.     return a
  20.   elif (a > b > c) or  (c > b > a):
  21.     return b
  22.   else:
  23.     return c
  24.  
  25. a, b, c = (
  26.   int(input('Type a number for a: ')),
  27.   int(input('Type a number for b: ')),
  28.   int(input('Type a number for c: '))
  29. )
  30.  
  31. i1 = smallest_num(a, b, c)
  32. i2 = middle_num(a, b, c)
  33. i3 = biggest_num(a, b, c)
  34.  
  35. print(f"Order: {i1}, {i2}, {i3}")
  36.  
  37. #Talice ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement