BlogsOfLei
#用户输入,操作
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")

 

分类:

技术点:

相关文章:

  • 2021-11-13
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2021-06-14
  • 2021-05-22
  • 2021-08-25
  • 2022-12-23
猜你喜欢
  • 2021-08-06
  • 2021-09-07
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案