+ 2
Speed complain
why does it take so long to print output while writing codes in python?? i tried some codes in the "code playground" and it took ages to print output (it wasn't error).. can someone explain this to me?
1 Odpowiedź
+ 20
This is what happened when you press the RUN button @ Code Playground:
(1) Scan the source code locally by matching keywords that read user input. If it's required, ask the user to provide beforehand in one-go. That means step-by-step/sequential input will not work. This is how most online compiler works otherwise the server resource will be withhold indefinitely if the user didn't provide any input.
(2) Send the source code to the server to compile. The server maybe a few thousand km/mile from you which caused the delay.
(3) The server responds with the code output or compilation error message if it the source code is invalid. You may get errors occasionally as well if the server is busy.
P/S: This doesn't apply to the Web code as it's directly run in user's device WebView and hence it always produce the result almost instantly. 😉