标签:print dmi min 字符串 roo mat bsp code div
print("i am %s" %‘admin‘) # i am admin msg = "i am %s" %‘Alex‘ print(msg) # i am Alex print("i am %s, i am %d" %(‘admin‘, 18)) # i am admin, i am 18 tp1 = ‘i am %(name)s age %(age)d‘ % {‘name‘:‘alex‘, ‘age‘:18} print(tp1) # i am alex age 18 # 加颜色 \033[43;1m........\033[0m print(‘\033[45;1mhello\033[0m‘) print(‘root‘, ‘x‘, ‘0‘, ‘0‘, sep=‘:‘) # root:x:0:0 # format tp2 = ‘i am {}, age {}, {}‘.format(‘alex‘, 28, ‘hhh‘) print(tp2) # i am alex, age 28, hhh
标签:print dmi min 字符串 roo mat bsp code div
原文地址:https://www.cnblogs.com/xiangtingshen/p/10372450.html