#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})
运行界面如下
领取专属 10元无门槛券
私享最新 技术干货