[Python学习篇] Python输入

关键字 input

语法:input("提示信息")

特点

  • 当程序执行到input,等待用户输入,输入完成之后才能继续向下执行。
  • input接收用户输入后,一般存储到变量中,方便使用。
  • input会把接收到的任意用户输入的数据都当做字符串处理。

示例

python 复制代码
# input 输入结果存在变量password中
password = input("请输入您的密码:")
# 打印变量数据
print(f'您输入的密码是{password}')
# 打印数据类型
print(f'数据类型是{type(password)}')
相关推荐
copyer_xyf7 分钟前
Agent 流程编排
后端·python·agent
copyer_xyf32 分钟前
Agent RAG
后端·python·agent
copyer_xyf35 分钟前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf1 小时前
Agent 记忆管理
后端·python·agent
星云穿梭16 小时前
用Python写一个带图形界面的学生管理系统——完整教程
python
金銀銅鐵16 小时前
用 Pygame 实现 15 puzzle
python·数学·游戏
黄忠1 天前
大模型之LangGraph技术体系
python·llm
hboot1 天前
AI工程师第二课 - 数据处理
人工智能·python·数据分析
用户8356290780512 天前
使用 Python 自动化 PowerPoint 形状布局与格式设置
后端·python
用户8356290780512 天前
用 Python 自动化 PowerPoint 演讲者备注添加
后端·python