輸入函數raw_input():
raw_input()函數將所有輸入作爲字符串看待,返回字符串類型
>>>a = raw_input("Please input a:")
Please input a: 354
>>>a
'354'
>>> type(a)
<class 'str'>
轉換函數eval():
eval()函數將字符串類型返回爲元組
>>>eval(a)
354
>>> type(eval(a))
<class 'int'>
raw_input()函數將所有輸入作爲字符串看待,返回字符串類型
>>>a = raw_input("Please input a:")
Please input a: 354
>>>a
'354'
>>> type(a)
<class 'str'>
eval()函數將字符串類型返回爲元組
>>>eval(a)
354
>>> type(eval(a))
<class 'int'>