'a'
>>> 'abcdefg'[-1]
'g'
>>> 'abcdefg'[0:3]
'abc'
>>> 'abcdefg'[3:-1]
'def'
>>> 'abcdefg'[3:]
'defg'
>>> 'abcdefg'[:3]
'abc'
>>> 'abcdefg'[1::2]
'bdf'
>>> 'abcdefg'[::-1]
'gfedcba'
>>> '83 69 67 79 78'.split()
['83', '69', '67', '79', '78']
>>> '53:45:43:43:4f:4e'.split(':')
['53', '45', '43', '43', '4f', '4e']
>>> ' '.join(['83', '69', '67', '79', '78'])
'83 69 67 79 78'
>>> ':'.join(['53', '45', '43', '43', '4f', '4e'])
'53:45:43:43:4f:4e'
>>> import hashlib
>>> hashlib.md5('abc').hexdigest()
'900150983cd24fb0d6963f7d28e17f72'
>>> hashlib.sha1('abc').hexdigest()
'a9993e364706816aba3e25717850c26c9cd0d89d'
>>> hashlib.sha256('abc').hexdigest()
'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'
>>> hashlib.sha512('abc').hexdigest()
'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f'
0 件のコメント:
コメントを投稿