How do you convert float to string using def?
I found out that if you say something like: user=float(5) #user is a float s=(user) + (2) #equation solved as float user=str(user) #user is a string w=(user) + (" is a number") #equation solved as string You essentially converted a float into a string. So in between those two lines you could write an equation and it would then solve as a float then after you converted it into a string you could write an equation and it solve it as a string. So my question is how do you do that as a def statement? I tried: user=float(12) #user is a float def convert(x): #variable is supposed to convert into string x=str(x) user(convert) #thus user should be converted into a string. But it doesn't convert into a string, it is still defined as a float. Is there a way to convert a variable into a string using def?