Moderator: does this code execute correctly?
Dear Sir: This script SHOULD build a grid with staggered columns. I am not satisfied that it should stagger in the direction that I want it to, but standing alone, it should do SOMETHING. I keep getting a grid of identical rows. Is it my anaconda3; is it a code optimization? I know it sounds like incompetence on my part, but it's pretty straightforward. Am I actually an idiot, or is this an artifact? Regards, James J Abilene, TX
On Fri, 18 Nov 2022 at 18:01, James Johnson <jj126979@gmail.com> wrote:
Dear Sir:
This script SHOULD build a grid with staggered columns. I am not satisfied that it should stagger in the direction that I want it to, but standing alone, it should do SOMETHING.
I keep getting a grid of identical rows. Is it my anaconda3; is it a code optimization?
I know it sounds like incompetence on my part, but it's pretty straightforward.
Am I actually an idiot, or is this an artifact?
You're re-appending the same row every time. So at the end, it's many references to the same row. This sort of question would be better answered on python-list or python-tutor though, it's not an idea for the future development of Python. ChrisA
I am a certified idiot. I will learn how to query python tutor. Apologies, James On Fri, Nov 18, 2022 at 1:07 AM Chris Angelico <rosuav@gmail.com> wrote:
On Fri, 18 Nov 2022 at 18:01, James Johnson <jj126979@gmail.com> wrote:
Dear Sir:
This script SHOULD build a grid with staggered columns. I am not
satisfied that it should stagger in the direction that I want it to, but standing alone, it should do SOMETHING.
I keep getting a grid of identical rows. Is it my anaconda3; is it a
code optimization?
I know it sounds like incompetence on my part, but it's pretty
straightforward.
Am I actually an idiot, or is this an artifact?
You're re-appending the same row every time. So at the end, it's many references to the same row.
This sort of question would be better answered on python-list or python-tutor though, it's not an idea for the future development of Python.
ChrisA
-- Truth causes consequences; consequences bring pain; pain exorcises guilt!
participants (2)
-
Chris Angelico
-
James Johnson