输出格式美化
str(): 函数返回一个用户易读的表达形式。
repr(): 产生一个解释器易读的表达形式。
{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x)
旧式字符串格式化
print('常量 PI 的值近似为:%5.3f。' % 3.14)
读取键盘输入
input()

看案例:

import math
#输出格式美化
s = 'hello, 123. ,word'
print(str(s))# hello, 123. ,word
print(repr(s))# 'hello, 123. ,word'

for x in range(1, 11):
print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x))

print('常量 PI 的值近似为:%5.3f。' % math.pi)

#输入
str = input("请输入:")
print ("你输入的内容是: ", str)