+ 1

What does it mean by "repeatedly exexutes that line"?

"The Python console is a program that allows you to enter one line of python code, repeatedly executes that line, and displays the output." Why would it repeatedly execute a line???

8th Aug 2016, 10:42 PM
Terrance Banh
Terrance Banh - avatar
5 ответов
+ 2
here's a more concise explanation from the comments on "The Python Console" direct quote regards of @John from 7/13/2016: REPL is the method used in the Python Console. The program (python) reads line 1, evaluates line 1, prints line 1, then repeats this process (loops) in line 2, so on and so forth. This does not correlate to the lesson at hand besides helping you understand the way Python works behind the console so you can later have some insight into where the errors happened and why. I hope this answers your question. Have fun learning! end quote.. don't confuse (loops) here with code loops like for, while, etc. it is an iterative process looping over line by line. his answer makes the best sense to me. many are / were also confused. you can view those comments from the course itself. with the above thoughts, maybe forget what I said earlier. ;)
9th Aug 2016, 12:09 AM
Izz
Izz - avatar
+ 1
I, too, am unsure of this verbiage. the interpreter is exactly that, a line by line interpreter, so each line is held (and by an interpreter's definition ran) in memory until a piece of code tells it to stop. think of inputting one line at a time of the following conditional loop: result = 0 while x != "q": x = input("please enter a number from 1 - 5 and I will add them, or q to quit: ") result += x print("the answer is: %d" % result) every line is being ran to see if current status terminates previous line, until returning to the interpreter >>> which you can just type: >>> result and get the value the interpreter stores and runs all code, line by line, but repeatedly until termination. or...I could be completely wrong in my interpretation of the statement, and therefore believe it is a typo. ;)
8th Aug 2016, 11:25 PM
Izz
Izz - avatar
+ 1
well, I did go all around the world to try and justify my logic. :p I'll do some research and see. this honestly seems like an incorrect statement "repeatedly executes that line".
8th Aug 2016, 11:43 PM
Izz
Izz - avatar
0
Thanks for your thoughtful reply but I think I'm having troubles interpreting your answer XD. Sorry for my newb like knowledge
8th Aug 2016, 11:37 PM
Terrance Banh
Terrance Banh - avatar
0
it executes the line repeatedly?
9th Aug 2016, 10:32 AM
Sam Sharp
Sam Sharp - avatar