W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
Python3.x 中 input() 函數(shù)接受一個標(biāo)準(zhǔn)輸入數(shù)據(jù),返回為 string 類型。
注意:在 Python3.x 中 raw_input() 和 input() 進行了整合,去除了 raw_input( ),僅保留了input( )函數(shù),其接收任意任性輸入,將所有輸入默認(rèn)為字符串處理,并返回字符串類型。
input([prompt])
參數(shù)說明:
input() 需要輸入python 表達式:
>>>a = input("input:")
input:123 # 輸入整數(shù)
>>> type(a)
<class 'str'> # 字符串
>>> a = input("input:")
input:w3cschool # 正確,字符串表達式
>>> type(a)
<class 'str'> # 字符串
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: