- 1

What's wrong with this program

celsius()= int(input()) def conv(): conv() = (9//5*celsius)+32 return conv() def fahrenheit (): Fahrenheit = conv(celsius()) print Fahrenheit

1st Jun 2022, 7:55 AM
Hossameldin Mohamed
Hossameldin Mohamed - avatar
2 Respostas
+ 8
Hossam Mohamed , sorry to say, but there are too many issues with your code. before proceeding you should repeat the last lessons, do practicing as much as possible, then do a new try celsius()= int(input()) # celsius() has to be a variable, don't need parenthesis def conv(): # needs a parameter / variable to hold the input conv() = (9//5*celsius)+32 # conv() has to be a variable, don't need parenthesis, also use other name because conv is already used for the function # formula is not correct, should be (9/5*celsius)+32 return conv() # has to be a variable without parenthesis def fahrenheit (): # not required remove it Fahrenheit = conv(celsius()) # celsius is a variable that can not have parenthesis print Fahrenheit # print needs to have parenthesis with variable Fahrenheit inside
1st Jun 2022, 10:53 AM
Lothar
Lothar - avatar