converting strings to numbers the typeerror examples in the previous section highlight common problem when applying user input to an operation that requires number and not stringtype mismatches let' look at an example save and run the following programnum input("enter number to be doubled"doubled_num num print(doubled_numif you entered the number at the promptthen you would expect the output to be but in this caseyou would get rememberinput(always returns stringso if you input then num is assigned the string " "not the integer thereforethe expression num returns the string " concatenated with itselfwhich is " to perform arithmetic on numbers contained in stringyou must first convert them from string type to number type there are two functions that you can use to do thisint(and float(int(stands for integer and converts objects into whole numberswhereas float(stands for oating-point number and converts objects into numbers with decimal points here' what using each one looks like in the interactive windowint(" " float(" " notice how float(adds decimal point to the number floatingpoint numbers always have at least one decimal place of precision for this reasonyou can' change string that looks like floating-point number into an integer because you would lose everything after the decimal point