In [1]:
2 + 2
Out[1]:
In [2]:
3 - 8
Out[2]:
In [3]:
6 * 9
Out[3]:
In [4]:
8 / 2
Out[4]:
In [5]:
5 % 2
Out[5]:
In [6]:
5 ** 2
Out[6]:
In [7]:
10 / 3
Out[7]:
In [8]:
10 // 3
Out[8]:
In [9]:
5.0
Out[9]:
In [10]:
5.0 + 5.2
Out[10]:
In [11]:
10.2 + 8
Out[11]:
In [12]:
'Hello,world'
Out[12]:
In [13]:
"Hello,world"
Out[13]:
In [14]:
'吾輩は蛇である'
Out[14]:
In [15]:
print('I\'m Hiroki')
In [16]:
print('Hello\nworld')
In [17]:
"""foo
bar
baz
"""
Out[17]:
In [18]:
'Mt.' + 'Fuji'
Out[18]:
In [19]:
'スパム' * 5
Out[19]:
In [20]:
'python'[1]
Out[20]:
In [21]:
'python'[2:5]
Out[21]:
In [22]:
'python'[:3]
Out[22]:
In [23]:
'python'[4:]
Out[23]:
In [24]:
len('python')
Out[24]:
In [25]:
't' in 'python'
Out[25]:
In [26]:
'k' in 'python'
Out[26]:
In [27]:
'th' in 'python'
Out[27]:
In [28]:
'pain-au-chocolat'.split('-')
Out[28]:
In [29]:
'-'.join(['pain', 'de', 'campagne'])
Out[29]:
In [30]:
b'\x89PNG\r\n\x1a\n'
Out[30]:
In [31]:
"日本".encode('utf-8')
Out[31]:
In [32]:
b'\xe6\x97\xa5'.decode('utf-8')
Out[32]: