Question: I am reading data from a cvs file and when I import data into a list it will treat the numbers as strings.
This is the output: `['1.0', '1.20798878439', '1.52379907139']` but I want something like this `[1.0, 1.20798878439, 1.52379907139]` so that I am dealing with real numbers and NOT strings? Any suggestions?

Answer: 
```
my_string_list = ['1.0', '1.20798878439', '1.52379907139']
my_int_list = [float(i) for i in my_string_list]

```

You'd simply iterate over it an convert it to the data type you need.

As pointed out by @IanAuld - This is called [type casting](http://www.tutorialspoint.com/cprogramming/c_type_casting.htm) or [type conversion](https://stackoverflow.com/questions/2375334/python-type-conversion).

There are libraries that can handle trickier conversions for you.  

But the bare essentials are a `for` loop, iterate over each object in your list and convert it and finally place the result in a new list.

If i were to expand my answer from using `list comprehensions` to a regular for loop, it would look like this:

```
my_string_list = ['1.0', '1.20798878439', '1.52379907139']
my_int_list = []
for item in my_string_list:
    my_int_list.append(float(item))

```
You can type cast and create a new list easily by using a list comprehension like so:

```
>>> [float(x) for x in ['1.0', '1.20798878439', '1.52379907139']]
[1.0, 1.20798878439, 1.52379907139]

```

Using variables:

```
>>> a = [1.0, 1.20798878439, 1.52379907139]
>>> b = [float(x) for x in a]
>>> print(b)
[1.0, 1.20798878439, 1.52379907139]

```

For more information on list comprehensions:
<https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions>