I just started learning to program with Python for private interest and I am following a on-line bootcamp. I am supposed to solve some exercises and I started very soon to find the firse difficulties. So, I have this list:
chaos =["old price: 40", "new price: 21", "old price: 29", "old price: 50", "new price: 101"]
and I would like to insert the list "chaos" in the variable l in order to split it on the colon, so I typed:
l = chaos.split(":")
print(l)
and, as follows, the error message:
AttributeError Traceback (most recent call last)
<ipython-input-12-31400247da2e> in <module>
1 chaos =["old price: 40", "new price: 21", "old price: 29", "old price: 50", "new price: 101"]
2
----> 3 l = chaos.split(":")
4
5 print(l)
Error:
AttributeError: 'list' object has no attribute 'split'
I wrote and rewrote it after looking other examples and tutorials but I don´t really understand what I am doing wrong. Can somone help me?