lundi 1 janvier 2018

if elif else: Unsupported opperands str & int

I get a TypeError: unsupported operands (str & int) at about line 5. I've looked up how to actually fix it but nothing has worked for me because my teacher wants this in if, elif, else form. I also couldn't seem define the variable without declaring them x and y.

I can't even see how my print statements after the if are affected because I can't get past the line 5 error. Does anyone have a solution or work around?

Temp2=str(input("This is program will convert your temperature system to its opposite. Re-enter the temeprature."))
x=(Temperature - 32)*5/9
y=(Temperature * 1.8)+32
if Type == x:
  print(+Temperature+ " degrees Fahrenheit is " + Temperature+ " degrees Celsius.")

Aucun commentaire:

Enregistrer un commentaire