Pythonic——打印输出

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cj675816156/article/details/80043004

Pythonic完美打印方式:

print("Hello %(name)s!" % {'name': 'ChenJun'})

student = {'name': 'Tom', 'age': 15, 'score': 96}
print('Student: %(name)s age: %(age)s' % student)

print("name: {name} age: {age}".format(name='ChenJun', age=100))

猜你喜欢

转载自blog.csdn.net/cj675816156/article/details/80043004