print("This is a conversion program from fahrenheit(f) to celsius(C) and vice versa")
temp = None
unit = None
while temp is None:
try:
temp = float(input("Enter your temperature please:"))
except ValueError:
print("ValueError: could not convert string to float")
while unit not in ("F", "C"):
unit = input("Please enter the unit ( F/C ):").lower()
if unit == "F":
result = round((temp - 30) / 2)
print(f"{temp} fahrenheit correspond to {result} celsius")
elif unit == "C":
result = round(temp * 2 + 30, 3)
print(f"{temp} celsius corresponds to {result} fahrenheit")
for some reasons, when i get to the unit part, u keep getting "Please enter the unit ( F/C ):" and i don't understand why, help !