Convert strings to int or float in Python 3?
问题 integer = input("Number: ") rslt = int(integer)+2 print('2 + ' + integer + ' = ' + rslt) double = input("Point Number: ") print('2.5 + ' +double+' = ' +(float(double)+2.5)) Gives me Traceback (most recent call last): File "C:\...", line 13, in <module> print('2 + ' + integer + ' = ' + rslt) TypeError: Can't convert 'int' object to str implicitly I'm fairly new to programming and my background is mostly just the basics of C# so far. I wanted to try to learn Python through doing all my C#