鍵盤輸入:
(1)a = input("請輸入:") # 默認只能輸入字符串類型,輸入其他類型會報錯。
print("您輸入的為:%s" % (a))
(2)b = int ( input("請輸入:" ) ) # 可調整想要輸入的類型。
print("您輸入的為:%d" %(b) );
鍵盤輸入:
(1)a = input("請輸入:") # 默認只能輸入字符串類型,輸入其他類型會報錯。
print("您輸入的為:%s" % (a))
(2)b = int ( input("請輸入:" ) ) # 可調整想要輸入的類型。
print("您輸入的為:%d" %(b) );
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。