Python Forum
Cant Append a word in a line to a list err "str obj has no attribute append
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cant Append a word in a line to a list err "str obj has no attribute append
#1
Hey everyone,

I am trying to get every word in line to a list however i am getting error " AttributeError: 'str' object has no attribute 'append'". Any ideas are welcome, thanks in advance.

if satırsayısı2==isimsatırlistesi[0]:
        for word in line2:
            word.append(str(adressatırı)) #[b]AttributeError: 'str' object has no attribute 'append'[/b]
            satırdakikelimesayısı=len(adressatırı)
            print(adressatırı[2:satırdakikelimesayısı])
Reply
#2
wrd=[]
if satırsayısı2==isimsatırlistesi[0]:
        for word in line2:
            wrd.append(str(adressatırı)) 
            satırdakikelimesayısı=len(adressatırı)
            print(adressatırı[2:satırdakikelimesayısı])
entireLine=",".join(wrd)
Reply
#3
You have not supplied enough information. What is line2? What is adressatiri? What are your trying to do with this:
word.append(str(adressatırı))
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  .json overwrites, rather than append?? Clives 12 469 Jun-07-2021, 04:13 PM
Last Post: buran
  Better way to append frames from a video to multiple lists? Balaganesh 0 226 May-13-2021, 07:37 AM
Last Post: Balaganesh
  How to append a value to specific excel cell using openpyxl hobbyist 0 616 Mar-05-2021, 07:14 PM
Last Post: hobbyist
  Append excel sheet using openpyxl TammyP 1 415 Feb-02-2021, 06:32 PM
Last Post: nilamo
  How to append multiple <class 'str'> into a single List ahmedwaqas92 2 504 Jan-07-2021, 08:17 AM
Last Post: ahmedwaqas92
  Add a row to a dataframe or append whole dataframe. tsurubaso 1 327 Jan-07-2021, 01:53 AM
Last Post: tsurubaso
  Trying to get the first letter of every word in a list DanielCook 2 434 Jan-05-2021, 05:06 PM
Last Post: deanhystad
  Append 2d empty lists NMMST 2 420 Oct-19-2020, 09:25 PM
Last Post: NMMST
  How to append to a set in Python dgrunwal 7 723 Oct-01-2020, 04:27 PM
Last Post: ndc85430
  Passing List of Objects in Command Line Python usman 7 885 Sep-27-2020, 03:45 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020