非要输出这样吗?{1: 'int', 2.0: 'float', '3': 'str'},可以在类型后面加上__name__
di = {1: type(1).__name__, 2.0: type(2.0).__name__, "3": type("3").__name__} print(di) print(type(di)) # {1: 'int', 2.0: 'float', '3': 'str'} # <class 'dict'>