>>> s = 'RUNOOB'
>>> repr(s)
"'RUNOOB'"
>>> dict = {'runoob': 'runoob.com', 'google': 'google.com'};
>>> repr(dict)
"{'google': 'google.com', 'runoob': 'runoob.com'}"
s="物品\t单价\t数量\n包子\t1\t2"
print('01', s)
print('02', repr(s))
输出:
01 物品 单价 数量
包子 1 2
02 '物品\t单价\t数量\n包子\t1\t2'
import decimal
print('1e4 ', repr(1e4))
print('10e4', repr(10e3))
print(int(50e3))
print(int(10e3))
print(int(0b10))
print(int(0x1f))
print(1.24e3, type(1.24e3))
print(decimal.Decimal(10e3))
输出:
1e4 10000.0
10e4 10000.0
50000
10000
2
31
1240.0 <class 'float'>
10000
标签:google,数字,runoob,int,float,repr,print,com
From: https://www.cnblogs.com/heris/p/16586702.html