我想你是多少歲轉化爲天:時遇到一個代碼
print "age into days converter"
name = raw_input("What is your name: ")
age = raw_input("How old are you: ")
days_in_years = 365
age_in_days = age * days_in_years
print "You are %s days old" %age_in_days
但是,它打印你的年齡,而不是365次相乘的。我試着用輸入,INT(, 並試圖將其轉換爲浮點值,但它仍然是行不通的。
的可能的複製[Python的:問題與原始\ _Input讀取數](http://stackoverflow.com/questions/5762938/python-problem-with-raw-input-reading-a-number) –
「但它不能正常工作」所以出了什麼問題?告訴我們你錯在哪裏,我們可以幫助解釋這一方面。 –
可能重複的[我如何在Python中讀取輸入爲整數?](http://stackoverflow.com/questions/20449427/how-can-i-read-inputs-as-integers-in-python) –