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