2.py 618 B

12345678910111213141516171819202122232425
  1. import os
  2. def printLowest():
  3. "Takes to numbers from prompt and prints the lowest of them"
  4. # Assign the prompted numbers to variables x and y
  5. x = int(input("Enter a number: "))
  6. y = int(input("Enter another number: "))
  7. # Test if x is lesser than y
  8. if x < y:
  9. print(x)
  10. # Test if y is lesser than x
  11. elif y < x:
  12. print(y)
  13. # If previous conditionals weren't met, assume equal values
  14. else:
  15. print("Both numbers are ", x)
  16. return
  17. # Clear screen
  18. os.system("clear") # Mac or Linux
  19. # os.system("cls") # Windows
  20. # Call to function printLowest()
  21. printLowest();