Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def PythagTripCheck():
- sidesCount=0
- smallSideDone=False
- mediumSideDone=False
- largeSideDone=False
- while sidesCount<3:
- whatSide=input("What side would you like to enter first? 'Small', 'Medium' or 'Large'?")
- if whatSide=="Small" or "small" or "S" or "s":
- if smallSideDone=True:
- print("Hey! You've already inputted a small side!")
- else:
- smallSide=input("Enter the length of the small side:")
- if smallSide.isdigit() == False:
- print("The small side contains a character which is not a number, your numbers have been reset, try again")
- PythagTripCheck()
- else:
- sidesCount=sidesCount+1
- smallSideDone=True
- elif whatSide=="Medium" or "medium" or "M" or "m":
- if mediumSideDone=True:
- print("Hey! You've already inputted a medium side!")
- else:
- mediumSide=input("Enter the length of the medium side:")
- if mediumSide.isdigit() == False:
- print("The medium side contains a character which is not a number, your numbers have been reset, try again")
- PythagTripCheck()
- else:
- sidesCount=sidesCount+1
- mediumSideDone=True
- elif whatSide=="Large" or "large" or "L" or "L":
- if largeSideDone=True:
- print("Hey! You've already done a large side!")
- else:
- largeSide=input("Enter the length of the large side")
- if largeSide.isdigit() == False:
- print("The large side contains a character which is not a number, your numbers have been reset, try again")
- PythagTripCheck()
- else:
- sidesCount=sidesCount+1
- largeSideDone=True
- else:
- print("Please try again")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement