python - AttributeError: 'tuple' object has no attribute ...
stackoverflow.com › questions › 17290114Jun 25, 2013 · Variables names are only locally meaningful. Once you hit. return s1,s2,s3,s4. at the end of the method, Python constructs a tuple with the values of s1, s2, s3 and s4 as its four members at index 0, 1, 2 and 3 - NOT a dictionary of variable names to values, NOT an object with variable names and their values, etc.
Tuple no attribute error - Python Forum
python-forum.io › thread-13250Then line will be a string which you can split. You could also access only the second element of the tuple - the string you want to split: 1. 2. for line in enumerate(yrs_file): (pdate,catg,amt,howp) = line [1].split (',') But in any case, I don't really see why you would need enumerate () in your code at all. Reply.