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函数的格式化输出知识点

相关推荐
weelinking2 小时前
【产品】12_接入数据库——让数据永久保存
jvm·数据库·python·react.js·数据挖掘·前端框架·产品经理
石山代码2 小时前
ArrayList / HashMap / ConcurrentHashMap
java·开发语言
程序大视界3 小时前
【Python系列课程】Python正则表达式(下):环视、命名分组与日志实战
开发语言·python·正则表达式
TickDB3 小时前
美股行情 API 接入避坑:REST 快照、WebSocket 推送、盘前盘后数据的边界
人工智能·python·websocket·行情数据 api
枫叶v.3 小时前
Agent 分层存储架构设计:从记忆方法到中间件选型
开发语言·python
水兵没月3 小时前
逆向实战小记——某ToB商城网站分析学习
python·网络爬虫
程序员小远4 小时前
Python自动化测试框架及工具详解
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·接口测试
sleven fung5 小时前
MinerU与BabelDOC与KTransformers与OpenAI API库
开发语言·python·ai·langchain
小毛驴8505 小时前
spring-boot-maven-plugin,maven-compiler-plugin 功能对比
java·python·maven
萤萤七悬5 小时前
【Python笔记】AI帮实现CLI工具-使用argparse.ArgumentParser接收命令参数
开发语言·笔记·python