Dec-21-2020, 04:14 AM
In this case you only have one line above it. Move that line below the function, and leave a couple of blank lines below the function to serve as a visual break.
Now you can start reading your code execution from that point (and mentally ignore the stuff inside the function).
You can't use a variable (like
You call the function later in the for loop, and assign
Now you can start reading your code execution from that point (and mentally ignore the stuff inside the function).
You can't use a variable (like
history
) unless you've assigned a value to it. The assignment inside read_history()
doesn't count.You call the function later in the for loop, and assign
history
at that time (line 59). You can refer to or print history
anytime after that.