my code produces this result
[['1.2', ' 4.3', ' 7', '0'], ['3', ' 5', ' 8.2', '9'], ['4', ' 3', ' 8', '5.6'], ['8', ' 4', ' 3', '7.4']]
but i want to remove the ' '
def main():
my_list = [line.strip().split(',') for line in open("Alpha.txt")]
print(my_list)
main()
i attempted to convert the list into floats but it keeps returning errors. I need a way to convert the current list in this format into floats.
[float(i) for i in lst]
this hasnt worked for me because it seems to error out when trying to use float(my_list)