Python基础入门例程5-NP5 格式化输出(一)

目录

描述

输入描述:

输出描述:

示例1

解答:

说明:


描述

牛牛、牛妹和牛可乐正在Nowcoder学习Python语言,现在给定他们三个当中的某一个名字name,

假设输入的name为Niuniu,则输出 I am Niuniu and I am studying Python in Nowcoder!

请按以上句式输出相应的英文句子。

输入描述:

一行一个字符串表示名字。

输出描述:

假设输入的name为Niuniu,则输出I am Niuniu and I am studying Python in Nowcoder!

请按以上句式输出相应的英文句子。

示例1

输入:

复制代码
Niuniu

输出:

复制代码
I am Niuniu and I am studying Python in Nowcoder!

解答:

python 复制代码
name = input()
print('I am %s and I am studying Python in Nowcoder!'%name)
#print('I am {} and I am studying Python in Nowcoder!'.format(name))
#print('I am {} and I am studying Python in Nowcoder!'.format(name))

说明:

考查print函数的格式化输出知识点

相关推荐
cup112 小时前
[技术复盘] Windows Python 打包实战:Nuitka 环境踩坑总结与 CI 自动化构建全指南
python·ai·环境变量·ci·nuitka·skill
aqi004 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵6 小时前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf7 小时前
Agent 流程编排
后端·python·agent
copyer_xyf7 小时前
Agent RAG
后端·python·agent
copyer_xyf7 小时前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf7 小时前
Agent 记忆管理
后端·python·agent
星云穿梭1 天前
用Python写一个带图形界面的学生管理系统——完整教程
python
金銀銅鐵1 天前
用 Pygame 实现 15 puzzle
python·数学·游戏