Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:19:08) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a = input() 17 >>> a 17 >>> type(a) <type 'int'> >>> b = raw_input() 17 >>> b '17' >>> type(b) <type 'str'> >>> -------------------- 2.7下只是缩进问题。