python3
TypeError: float() argument must be a string or a number, not 'list' python
You can't call float on a list directly. You can use map to call float on each item in the list. Like so:
b = map(float, a[0].split(""))
In python 3.x
b = list(map(float, a[0].split("")))
Or for more readability, use a list comprehension. Works for both python2 and python3:
b = [float(s) for s in a[0].split("*")]
But be sure the items after splitting are floatable
浙公网安备 33010602011771号