Advertisement
estefani-adriano

Bigger and smaller number! PYTHON

Oct 18th, 2023 (edited)
1,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | Software | 0 0
  1. # Bigger and smaller number!
  2.  
  3. n1 = int(input('Enter the first number: '))
  4. n2 = int(input('Enter the second number: '))
  5. n3 = int(input('Enter the third number: '))
  6. color = {'nothing' : '\033[m', 'green' : '\033[4;32m', 'yellow' : '\033[4;33m'}
  7.  
  8. smaller= n1
  9. if (n2 > n1 and n2 > n3):
  10.     smaller = n2
  11. if (n3 > n1 and n3 > n2):
  12.     smaller = n3
  13.  
  14. bigger = n1
  15. if (n2 < n1 and n2 < n3):
  16.     bigger = n2
  17. if (n3 < n1 and n3 < n2):
  18.     bigger = n3
  19.  
  20. print('{}The number {} is the biggest!{}'.format(color['green'], bigger, color['nothing']))
  21. print('{}The number {} is the smallest!{}'.format(color['yellow'], smaller, color['nothing']))
  22.  
  23. #by: Estéfani =D
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement