string to number or number to string in python string to number int: num = '10' int(num) # 输出 10 float: num = '10.5' # convert the num into string converted_num = float(num) number to string str(10) # '10'