单词
按首字母分类
任务:将
单词
列表
按首字母分类成
列表
字典
words = ['well', 'you', 'can', 'teach', 'seem', 'someone', 'how', 'to', 'prepare', 'for', 'however']
map = {}
for word in words:
# 提取首字母
start = word[0]
if start not in map:
map[start] = [word]
else:
text = "This is a sentence with several words"
words = re.findall(r'\b\w+\b', text)
print(words)
编写一个函数,交换指定字典的key和value。
例如:dict1={'a':1, 'b':2, 'c':3} --> dict1={1:'a', 2:'b', 3:'c'}
def exchange(dict1):
交换指定字典的key和value
:param dict1: 字典
:return: 字典
result = dict(zip(dict1.values(), dict1.keys()))
return..
gen_rectangle1 (Rectangle, 30, 20, 100, 200)
gen_rectangle1 (Rectangle1, 330, 20, 400, 200)
intersection (Rectangle, Rectangle1, RegionIntersection)
count_obj (RegionIntersection, Number1)
union1 (RegionIntersection, RegionUnion)
count_obj (RegionUnion, Number2)
connection (RegionUnion, ConnectedRegions)
count_obj (ConnectedRegions, Number3)
Matlab笔记:将列向量直接赋值给行向量
NEWEVA__zzera22:
Halcon无图像旋转时的图像拼接
m0_67899299:
Halcon中count_obj算子及其异常分析
weixin_47722297: