Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
When you run a script, Python is going to compile your script. Meaning its going to read the file and make sure its in the right format, spacing, indentation, keywords, colons, etc. Once that passes, it then reads the code and decides based on what you wrote, what goes first. Addtionally if there are any imports or classes or functions or variables, etc those will get defined or assigned. Then it starts with what you told it to start with. That could be the top line or the bottom depending on how you wrote it. By default most programming laguages operate in a serial based operation. Meaning, running one line of code or operation until its done and then it moves to the next. You can change this with threading. But that becomes a bit more complicated.
19th Jul 2016, 6:16 AM
jj Fer
jj Fer - avatar