How to Convert Variables
- 1). Open a text editor or interpreter for your language.
- 2). In the interpreter create a variable and assign a string to it. In Python, this looks like:
test = '5.5' - 3). Use a type cast to convert the variable to another type. Changing the string to a floating point number is the most sensible type cast. In Python:
float(test)
Source...