PDF Preview:
PDF Title : | Think Python: How to think like a computer scientist |
---|---|
Total Page : | 447 Pages |
Author: | Allen B. Downey |
PDF Size : | 2.1 MB |
Language : | English |
Rights : | oreilly.com |
PDF Link : | Available |
Summary
Here on this page, we have provided the latest download link for Think Python: How to think like a computer scientist PDF. Please feel free to download it on your computer/mobile. For further reference, you can go to oreilly.com
Think Python: How to think like a computer scientist – Book
If a program stops and seems to be doing nothing, it is “hanging”. Often that means that it is caught in an infinite loop or infinite recursion.
• If there is a particular loop that you suspect is the problem, add a print statement immediately before the loop that says “entering the loop” and another immediately after that says “exiting the loop”. Run the program. If you get the first message and not the second, you’ve got an infinite loop. Go to the “Infinite loop” section below.
• Most of the time, an infinite recursion will cause the program to run for a while and then produce a “RuntimeError: maximum recursion depth exceeded” error. If that happens, go to the “Infinite recursion” section below. If you are not getting this error but you suspect there is a problem with a recursive method or function, you can still use the techniques in the “Infinite recursion” section.
• If neither of those steps works, start testing other loops and other recursive functions and methods.
• If that doesn’t work, then it is possible that you don’t understand the flow of execution in your program. Go to the “Flow of execution” section below.
Think Python: How to think like a computer scientist PDF
Know more about our initiative
[yasr_visitor_votes size=”medium”]