r = [1, 2, 3, 4, 5, 1, 2, 3]
#r=[0, 1, 2, 3, 4, 5, 6, 7]
print(r.index(3))
print(r.index(3, 3))
print(r.count)
r.sort()
print(r)
r.sort(reverse=True)
print(r)
r.reverse()
print(r)
出力
2
7
2
[1, 1, 2, 2, 3, 3, 4, 5]
[5, 4, 3, 3, 2, 2, 1, 1]
[1, 1, 2, 2, 3, 3, 4, 5]
s = 'My name is halu.'
to_split = s.split(' ')
print(to_split)
x = '#'.join(to_split)
print(x)
出
['My', 'name', 'is', 'halu.']
My#name#is#halu.