AttributeError: 'list' object has no attribute 'strip'
stackoverflow.com › questions › 26571815Oct 26, 2014 · The following code is causing AttributeError: 'list' object has no attribute 'strip' and I do not how to fix it: #!/usr/bin/env python from __future__ import absolute_import, division, print_function from itertools import groupby DATA = [ ["Test", "A", "B01", 828288, 1, 7, 'C', 5], ["Test", "A", "B01", 828288, 1, 7, 'T', 6], ["Test", "A", "B01", 171878, 3, 7, 'C', 5], ["Test", "A", "B01", 171878, 3, 7, 'T', 6], ["Test", "A", "B01", 871963, 3, 9, 'A', 5], ["Test", "A", "B01", 871963, 3, 9, ...
How do I fix AttributeError: ‘list’ object has no attribute ...
askpythonquestions.com › 2021/07/27 › how-do-i-fixJul 27, 2021 · How do I fix AttributeError: ‘list’ object has no attribute ‘strip’. July 27, 2021 python, python-3.x. I’m doing the greedy gift-givers problem for USACO training and I keep getting an "AttributeError: ‘list’ object has no attribute ‘strip’" error. Here is my code: fin = open ('gift1.in','r') p= fin.readline ().split (",") np = int (p.strip ()) dictOfMoney = { fin.readline ().strip () : 0 for i in range (np) } while (True): giver = fin.readline ().strip () if (giver ...