python - 基本数据格式的基本操作 hash [], get(..), None.. 获得uniq list
访问量: 3
refer to: https://flexiple.com/python/check-if-key-exists-in-dictionary-python
基本跟ruby 一样
a = {'one': 1, 'two': 2}
a['one'] # => 1
a.get('not-exist-key') # => None
a['not-exist-key'] # => 报错
把一个list转换为uniq list:
a = "123"
set(list(a))