Python用戶終端輸入


#用戶輸入,操作
print("python 用戶輸入操作")

# input(提示字符串),函數阻塞程序,並提醒用戶輸入字符串
instr = input("please input the string: ")
print("input >> " + instr)

# 將輸入的字符串轉化成整數  int(str)
print("input to int >> " + str(int(instr)))

# 練習,輸入字符串為exit時才退出用戶輸入

while input("please input: ")!="exit":
    print("input error")

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM