print("welcome to the Pythagoras calculator")
print("please leave empty whenever asked for any sides of the triangle you do not have data for")
print("please answer every question with integers only")
side = input("which side would you like to be found?")
hyp = int(input("hypotenuse length:"))
if hyp == (''):
hyp = str(hyp)
adj = int(input("adjacent length:"))
if adj ==(''):
adj = str(adj)
opp = int(input("opposite length:"))
if opp == (''):
opp = str(opp)
while hyp == ("") and adj == (""):
print("you need to insert two values")
hyp = int(input("hypotenuse length:"))
adj = int(input("adjacent length:"))
opp = int(input("opposite length:"))
while hyp == ("") and opp == (""):
print("you need to insert two values")
hyp = int(input("hypotenuse length:"))
adj = int(input("adjacent length:"))
opp = int(input("opposite length:"))
while adj == ("") and opp == (""):
print("you need to insert two values")
hyp = int(input("hypotenuse length:"))
adj = int(input("adjacent length:"))
opp = int(input("opposite length:"))
while adj == ("") and opp == (""):
print("you need to insert two values")
hyp = int(input("hypotenuse length:"))
adj = int(input("adjacent length:"))
opp = int(input("opposite length:"))
while hyp == ("") and adj == ("") and opp == (""):
print("you need to insert two values")
hyp = int(input("hypotenuse length:"))
adj = int(input("adjacent length:"))
opp = int(input("opposite length:"))
I'm trying to create a Pythagoras calculator yet when I ask people to insert the length of the sides it pops up an error which says that basically I'm trying to use an int as a string ( in validation), I'm aware that I can´t use an int as a string I just can´t figure out how to operate with both string and integers in the same input ( I ask for an input and it is both a string and an integer).
Thanks