6 ответов
+ 2
#Please input in Farenheit
c = int(input())
Result = 9/5*c
print(Result)
+ 2
i got that. i have to use Class
+ 2
I did like you said but the problem the function doesn't get the value from the input
+ 2
Thank you 😀
+ 1
you can put user input as function argument
c = Conv.F2C(int(input()))
or just call it after getting input
i = int(input())
print(Conv.F2C(i))
0
there is no one solution. you can do somthing like this:
encapsulate conversion methods..
class Conv:
def F2C(f): #static
return 'make your f to c conversion'
def other_conversion_func():...
usage: c = Conv.F2C(100)