Python Forum
Storing data/output from a loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Storing data/output from a loop
#7
The problem is line 14. The append method modifies the list in place, so you don't need to assign the result to anything. In fact, the result is None. There error is because of that None. The join method needs a list or other sequence/iterable. None is none of those things, so you get an error.

Note that naming your list 'list' is a bad idea. The name 'list' is already used in Python, so if you use it for one of your variables, you can no longer access the built-in list function.

To fix it, rename your list 'strays', and remove the assignment so it's just:

strays.append(countn)
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Storing data/output from a loop - by Jason613 - Sep-28-2019, 01:24 PM
RE: Storing data/output from a loop - by ichabod801 - Sep-28-2019, 02:15 PM
RE: Storing data/output from a loop - by Jason613 - Sep-28-2019, 04:02 PM
RE: Storing data/output from a loop - by ichabod801 - Sep-28-2019, 05:01 PM
RE: Storing data/output from a loop - by Dora_Deng - Sep-29-2019, 08:01 AM
RE: Storing data/output from a loop - by Jason613 - Sep-29-2019, 02:33 PM
RE: Storing data/output from a loop - by ichabod801 - Sep-29-2019, 02:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I experimented with a loop, and I don't understand how I got my output thinwheats 7 3,000 Mar-18-2020, 07:33 PM
Last Post: buran

Forum Jump:

User Panel Messages

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