In [1]:
i = 100
In [2]:
s_i = str(i)
print(s_i)
In [3]:
print(type(s_i))
In [4]:
f = 0.123
In [5]:
s_f = str(f)
print(s_f)
In [6]:
print(type(s_f))
In [7]:
i = 0xFF
print(i)
In [8]:
s_i = str(i)
print(s_i)
In [9]:
f = 1.23e+10
print(f)
In [10]:
s_f = str(f)
print(s_f)
In [11]:
s_i_format = format(i, '#X')
print(s_i_format)
In [12]:
s_f_format = format(f, '.2e')
print(s_f_format)
In [13]:
l = [0, 1, 2]
In [14]:
s_l = str(l)
print(s_l)
In [15]:
print(type(s_l))
In [16]:
d = {'a': 1,
'b': 2,
'c': 3}
In [17]:
s_d = str(d)
In [18]:
print(s_d)
In [19]:
print(type(s_d))
In [20]:
import pprint
In [21]:
dl = {'a': 1, 'b': 2, 'c': [100, 200, 300]}
In [22]:
s_dl = str(dl)
print(s_dl)
In [23]:
p_dl = pprint.pformat(dl, width=10)
print(p_dl)
In [24]:
print(type(p_dl))