name = "ThulasiDhasan" map = {} for ch in name: map[ch] = map.get(ch, 0) + 1 print(map)
2. Flatten list of the list in Python
lst = [[2, 3, 5], [6, 7, 8], [9, 0, 1]] t_lst = [ele for sublist in lst for ele in sublist] print(t_lst)
name = "ThulasiDhasan" map = {} for ch in name: map[ch] = map.get(ch, 0) + 1 print(map)
lst = [[2, 3, 5], [6, 7, 8], [9, 0, 1]] t_lst = [ele for sublist in lst for ele in sublist] print(t_lst)
pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0...
No comments:
Post a Comment