Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Append not working
#4
append is a function that returns None. It does not return the list with an appended value.

Your code does not make any sense. It does this:
tag[N].append(tag[N].get('data_id') for N in range(len(tag))

id = []  #<-  This list is thrown away in the next line
for id in tag:
    data_id = id.get('data-id')
    print(id.append(data_id),str(data_id))
    #load id array list
    id.append(data_id)  # This is id from the for loop
Reply


Messages In This Thread
Append not working - by WiPi - May-05-2020, 02:12 PM
RE: Append not working - by anbu23 - May-05-2020, 03:13 PM
RE: Append not working - by WiPi - May-05-2020, 03:30 PM
RE: Append not working - by deanhystad - May-05-2020, 03:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Cant Append a word in a line to a list err "str obj has no attribute append Sutsro 2 2,588 Apr-22-2020, 01:01 PM
Last Post: deanhystad
  append not working as expected teachinggeek 2 2,266 Apr-09-2020, 04:32 AM
Last Post: buran
  append no working pythonduffer 3 2,763 Apr-12-2019, 06:32 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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