4 读取用户指令

1.语法

python 复制代码
input()  

2.示例

python 复制代码
#要求手动输入信息,打印信息卡  
Please input your name:xxx  
Please input your age:xxx  
Your hobbie:xxx  
  
----------xxx info----------  
name:xxx  
age:xxx  
hobbie:xxx  
-------------end-------------  
  
  
#实现代码  
name = input("Please input your name:")  
age = input("Please input your age:")  
hobbie = input("Your hobbie:")  
  
msg = f'''  
----------{name} info----------  
name:{name}  
age:{age}  
hobbie:{hobbie}  
-------------end-------------  
'''  
print(msg)  
相关推荐
金融小师妹1 天前
多因子智能推演:油价回落6%与黄金震荡上行的关联解析——AI预测框架
大数据·python·深度学习
BUG研究员_1 天前
Runnable与LCEL
开发语言·人工智能·python
老马聊技术1 天前
Pytorch深度学习环境配置与测试
人工智能·pytorch·python
Python私教1 天前
AI Agent 上生产要不要开写权限?我把执行链拆成 4 道闸门
人工智能·后端·python
天才测试猿1 天前
软件测试知识总结(基础篇)
自动化测试·软件测试·python·功能测试·测试工具·职场和发展·测试用例
崔子末1 天前
某影视库剧集列表以及查询接口逆向
爬虫·python
gogogo出发喽1 天前
v3 admin
python
问商十三载1 天前
RAG 检索效果差怎么排查?2026 五层诊断法完整指南
开发语言·人工智能·windows·python·算法
weixin_BYSJ19871 天前
springboot酒店管理系统--附源码27436
java·spring boot·python·随机森林·贪心算法·eclipse·django