a = string.split("Test Test2 Test3"," ")
This returns an error:
Message File Name Line Position
Traceback
<module> C:\pyWiz.py 43
AttributeError: 'module' object has no attribute 'split'
Yes, I imported the string module. Why is this happening?
Use:
a = 'Test Test2 Test3'.split(' ')
(i.e. split method of str type). string.split is deprecated in 2.x and gone in 3.x.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With