Python Forum
Help With While Loop and Append
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help With While Loop and Append
#1
Hi everyone. I am using python for coding an algorithm and I'm struggling with usage of while and append.

the part of code is:
print('isis')
print(temp11)
print(main_list[9][6])  # this variable's value is different now
temp_cluster.clear()
print(temp_cluster)
temp_cluster.append(Node_Names[temp11])
print(main_list[9][6])   # and the same variable's value is different now
Later on, I am changing main_list[9][6] to temp_cluster. but that is after the above sentences.
However the value of variable changes midway.

Here is same output:
Output:
isis 10 ['j', 'i'] # as you can see value has changed from 'j' 'i' to 'k' after 2 sentences [] ['k'] exy
Can anyone help me with this?
Reply


Messages In This Thread
Help With While Loop and Append - by laprus - Jan-30-2019, 11:02 AM
RE: Help With While Loop and Append - by buran - Jan-30-2019, 12:17 PM
RE: Help With While Loop and Append - by laprus - Jan-31-2019, 05:25 AM
RE: Help With While Loop and Append - by perfringo - Jan-31-2019, 06:49 AM
RE: Help With While Loop and Append - by laprus - Feb-03-2019, 09:19 AM
RE: Help With While Loop and Append - by perfringo - Feb-03-2019, 09:53 AM
RE: Help With While Loop and Append - by buran - Feb-03-2019, 09:59 AM
RE: Help With While Loop and Append - by laprus - Feb-05-2019, 05:09 AM
RE: Help With While Loop and Append - by perfringo - Feb-05-2019, 07:13 AM
RE: Help With While Loop and Append - by buran - Feb-05-2019, 07:49 AM
RE: Help With While Loop and Append - by laprus - Feb-06-2019, 05:55 AM
RE: Help With While Loop and Append - by perfringo - Feb-06-2019, 08:01 AM
RE: Help With While Loop and Append - by laprus - Feb-07-2019, 04:58 AM
RE: Help With While Loop and Append - by perfringo - Feb-07-2019, 07:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  why is the append function gets empty on the loop?/python rhai 3 3,206 Jul-07-2018, 12:19 PM
Last Post: rhai

Forum Jump:

User Panel Messages

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