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

相关推荐
databook7 小时前
Manim实现脉冲闪烁特效
后端·python·动效
程序设计实验室8 小时前
2025年了,在 Django 之外,Python Web 框架还能怎么选?
python
倔强青铜三9 小时前
苦练Python第46天:文件写入与上下文管理器
人工智能·python·面试
用户25191624271113 小时前
Python之语言特点
python
刘立军13 小时前
使用pyHugeGraph查询HugeGraph图数据
python·graphql
数据智能老司机16 小时前
精通 Python 设计模式——创建型设计模式
python·设计模式·架构
数据智能老司机17 小时前
精通 Python 设计模式——SOLID 原则
python·设计模式·架构
c8i19 小时前
django中的FBV 和 CBV
python·django
c8i19 小时前
python中的闭包和装饰器
python
这里有鱼汤1 天前
小白必看:QMT里的miniQMT入门教程
后端·python