This is a draft cheat sheet. It is a work in progress and is not finished yet.
                    
        
                
        
            
                                
            
                
                                                
                                
    
    
            Number
        
                        
                                                                                    
                                                                                            Fraction(2/3) => 6004799503160661/9007199254740992 | limit_denominator() => 2/3  | 
                                                                                 
                                                                                            
                                                                                            isinstance(variable, Number) => check Number  | 
                                                                                 
                                                                         
                             
    
    
            Function
        
                        
                                                                                    
                                                                                            lambda functions: defining function use only once  | 
                                                                                 
                                                                         
                             
    
    
            Classes
        
                        
                                                                                    
                                                                                            super().__init__ : tính thừa kế class  | 
                                                                                 
                                                                                            
                                                                                            @abstractmethod: khác class cùng thuộc tính, phương pháp nhưng output khác (có thể 1 chút)  | 
                                                                                 
                                                                                            
                                                                                            @classmethod: return class với một thuộc tính mới  | 
                                                                                 
                                                                                            
                                                                                            getattr(class, attribute_name) trả về giá trị của thuộc tính, nếu ko tồn tại thuộc tính thì return giá trị default đã cho vào function  | 
                                                                                 
                                                                                            
                                                                                            tạm skip  | 
                                                                                 
                                                                         
                             
                             | 
                                                                              | 
                                                        
                                
    
    
            List
        
                        
                                                                                    
                                                                                            random.choice() => 1 variable | random.choices() => list  | 
                                                                                                                          | 
                                                                                                                        'symbol'.join() join elements with symbol  | 
                                                                                 
                                                                                            
                                                                                            heapq.nlargest(int, list)  | 
                                                                                                                          | 
                                                                                                                        zip(iterator1, iterator2)  | 
                                                                                 
                                                                                            
                                                                                            |   | 
                                                                                                                          | 
                                                                                                                        unzip: zip(*list)  | 
                                                                                 
                                                                                            
                                                                                            |   | 
                                                                                                                          | 
                                                                                                                        (set1).union(set2)  | 
                                                                                 
                                                                                            
                                                                                            |   | 
                                                                                                                          | 
                                                                                                                        (set1).intersection(set2)  | 
                                                                                 
                                                                                            
                                                                                            |   | 
                                                                                                                          | 
                                                                                                                        filter(function, iterable)  | 
                                                                                 
                                                                                            
                                                                                            |   | 
                                                                                                                          | 
                                                                                                                        map(function, iterable) => element of iterable change  | 
                                                                                 
                                                                                            
                                                                                            |   | 
                                                                                                                          | 
                                                                                                                        list comprehensive  | 
                                                                                 
                                                                         
                             
                             | 
                                                                              | 
                                                        
                                
    
    
            Dict
        
                        
                                                                                    
                                                                                            list1.update(list2))  | 
                                                                                 
                                                                                            
                                                                                            .get(key, value) | no key -> value. no value -> key  | 
                                                                                 
                                                                         
                             
    
    
            Collections
        
                        
                                                                                    
                                                                                            namedtuple(): used as normal Python class  | 
                                                                                 
                                                                         
                             
                             | 
                                                                              | 
                                                        
                                
    
                             |