Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. def PythagTripCheck():
  2. sidesCount=0
  3. smallSideDone=False
  4. mediumSideDone=False
  5. largeSideDone=False
  6. while sidesCount<3:
  7. whatSide=input("What side would you like to enter first? 'Small', 'Medium' or 'Large'?")
  8. if whatSide=="Small" or "small" or "S" or "s":
  9. if smallSideDone=True:
  10. print("Hey! You've already inputted a small side!")
  11. else:
  12. smallSide=input("Enter the length of the small side:")
  13. if smallSide.isdigit() == False:
  14. print("The small side contains a character which is not a number, your numbers have been reset, try again")
  15. PythagTripCheck()
  16. else:
  17. sidesCount=sidesCount+1
  18. smallSideDone=True
  19. elif whatSide=="Medium" or "medium" or "M" or "m":
  20. if mediumSideDone=True:
  21. print("Hey! You've already inputted a medium side!")
  22. else:
  23. mediumSide=input("Enter the length of the medium side:")
  24. if mediumSide.isdigit() == False:
  25. print("The medium side contains a character which is not a number, your numbers have been reset, try again")
  26. PythagTripCheck()
  27. else:
  28. sidesCount=sidesCount+1
  29. mediumSideDone=True
  30. elif whatSide=="Large" or "large" or "L" or "L":
  31. if largeSideDone=True:
  32. print("Hey! You've already done a large side!")
  33. else:
  34. largeSide=input("Enter the length of the large side")
  35. if largeSide.isdigit() == False:
  36. print("The large side contains a character which is not a number, your numbers have been reset, try again")
  37. PythagTripCheck()
  38. else:
  39. sidesCount=sidesCount+1
  40. largeSideDone=True
  41. else:
  42. print("Please try again")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement