If we want to represent a group of values as key-value pairs then we should go for dict data type.
֍ Eg: d = {101:'durga',102:'ravi',103:'shiva'}
֍ Duplicate keys are not allowed but values can be duplicated. If we are trying to insert an entry with duplicate key then old value will be replaced with new value.
Eg: 1) >>> d={101:'durga',102:'ravi',103:'shiva'} 2) >>> d[101]='sunny' 3) >>> d 4) {101: 'sunny', 102: 'ravi', 103: 'shiva'} 5) 6) We can create empty dictionary as follows 7) d={ } 8) We can add key-value pairs as follows 9) d['a']='apple' 10) d['b']='banana' 11) print(d) Note: dict is mutable and the order won’t be preserved.
Note:
1) In general we can use bytes and bytearray data types to represent binary information like images, video files etc 2) In Python2 long data type is available. But in Python3 it is not available and we can represent long values also by using int type only. 3) In Python there is no char data type. Hence we can represent char values also by using str type.