Hello, I was learning about defining functions in fundamentals and I wrote this code:
opened_file = open('AppleStore.csv')
from csv import reader
read_file = reader(opened_file)
apps_data = list(read_file)
def list(a_row):
a_list=[]
For a_row in apps_data:
that_row = float(a_row)
a_list.append(that_row)
return a_list
Now the definition of the list function has changed and I can’t run codes any more and even when I click on restore initial code, when I run any code with list function I get this error because of list definition change:
Output
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-0ba9fba6fdf2> in <module>
2 from csv import reader
3 read_file = reader(opened_file)
----> 4 apps_data = list(read_file)
<ipython-input-1-30c3ee41a750> in list(a_row)
6 a_list=[]
7 for a_row in apps_data:
----> 8 that_row = float(a_row)
9 a_list.append(that_row)
10 return a_list
TypeError: float() argument must be a string or a number, not 'list'
Is there anything I can do to change it back?