Python Forum
Unexpected change to a list in a small amount of self-contained code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected change to a list in a small amount of self-contained code
#3
(Mar-13-2020, 02:07 AM)Johno Wrote: Why and what modifies alista?

Short answer: append (rows # 2 and 3 in your code) modifies alista. As of why - you should ask the author why the code is written this way and what the actual intention was.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: Unexpected change to a list in a small amount of self-contained code - by perfringo - Mar-13-2020, 06:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unexpected behavior accessing list elements. tonyflute 2 2,311 Apr-09-2021, 02:36 PM
Last Post: tonyflute
  Change each character of list into an different characters Angry_bird89 1 2,096 Jun-19-2020, 08:29 AM
Last Post: Angry_bird89
  Print the frequency of each coin for the combinations that sum to the amount N Pranav 3 2,604 May-19-2020, 06:16 AM
Last Post: Pranav
  Program that displays the number with the greatest amount of factors ilusmd 3 2,871 Nov-01-2018, 08:28 PM
Last Post: ichabod801
  i need to change the code woiwoi 3 3,022 Nov-28-2017, 05:37 PM
Last Post: nilamo
  Can't figure out small errors in my code? pythonwizard96 1 4,150 Nov-03-2017, 03:29 PM
Last Post: nilamo
  Looping over amount of attempts Beatenberg 4 6,346 Oct-17-2017, 07:47 AM
Last Post: Beatenberg

Forum Jump:

User Panel Messages

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