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

相关推荐
李永奉22 分钟前
杰理可视化SDK开发-【BUG】配置“TWS两边同时按消息使能”功能后,按键单击功能无效失灵
开发语言·单片机·嵌入式硬件·物联网·bug
m0_6174939435 分钟前
Python OpenCV 透视变换(Perspective Transform)详解与实战
开发语言·python·opencv
小李不困还能学38 分钟前
PyCharm下载安装与配置教程
ide·python·pycharm
程序猿编码1 小时前
用C++从零开始造一个微型GPT,不借助任何第三方库
开发语言·c++·gpt·模型推理
博观而约取厚积而薄发1 小时前
Pytest 从入门到精通,一篇就够(超详细实战教程)
python·测试工具·单元测试·自动化·pytest
imzed1 小时前
使用 Playwright + Pytest 构建 Web UI 自动化测试框架
python·自动化·pytest
普通网友1 小时前
pytest一些常见的插件
开发语言·python·pytest
苦瓜花1 小时前
【Kotlin】初入门
android·开发语言·kotlin
时空系1 小时前
Python 高性能高压缩打包器 —— 基于 JianPy 语义分析引擎
python