首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

1.3 XX你好,欢迎光临!

#XX你好,欢迎光临!

youname=input("请输入您的名字:")

print("%s你好,欢迎光临!" % youname)

##'''

##用到的知识点:

##

## * input("某字符串")函数:显示"某字符串",并等待用户输入.

## * print()函数:如何打印.

## * 如何应用中文

## * 如何用多行注释

## *printf-style string formatting

## *打印样式的字符串格式

##1.The '%' character, which marks the start of the specifier.

##2.Mapping key (optional), consisting of a parenthesised sequence of characters (for example, (somename)).

##3.Conversion flags (optional), which affect the result of some conversion types.

##4.Minimum field width (optional). If specified as an '*' (asterisk), the actual width is read from the next element of the tuple in values, and the object to convert comes after the minimum field width and optional precision.

##5.Precision (optional), given as a '.' (dot) followed by the precision. If specified as '*' (an asterisk), the actual precision is read from the next element of the tuple in values, and the value to convert comes after the precision.

##6.Length modifier (optional).

##7.Conversion type.

##

##print('%(language)s has %(number)03d quote types.' %{'language': "Python", "number": 2})

运行界面如下

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20180711G0HUNJ00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券