Help me wth python programming?

2014-02-01 5:10 pm
Hi , i am beginner of python programming. I downloaded python in my computer but when i write
def main():
celsius= eval (input("what is the celsius temperature ?"))
fahrenheit= 9/5 * celsius +32
print ("the temperature is ", fahrenheit, "degrees Fahrenheit.")
main()



i am supposed to get the converted answer. but when i run the module i am getting only
>>>what is the celsius temperature?
nothing else can u guys give me any solution i know i typed perfectly from book do i need to do anything after installing python to work it correctely

回答 (2)

2014-02-01 7:02 pm
✔ 最佳答案
It is asking for input. So when it displays:

    what is the celsius temperature?

You type in a number (and press enter):

    what is the celsius temperature? 20
    the temperature is 68.0 degrees Fahrenheit
2014-02-02 1:22 am
why does the fahrenheit have no quotes?


收錄日期: 2021-05-01 15:59:50
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20140201091003AAuMRjW

檢視 Wayback Machine 備份