python随手记
1、
data=123 isinstance(data,dict)#类型对比,相同返回true,不相同返回false
2、
globals()#globals 全局名字空间 locals()#locals 局部名字空间
3、
#str.replace(old, new[, max])把old字符串替换为new字符串,不超过max个 str = "Make a class named %%% that is-a %%%." new_str = str.replace("%%%", "hahaha", 1)
                    
                
                
            
        
浙公网安备 33010602011771号