Hardware Reference
In-Depth Information
Help with Functions
When you type a function like choice in IDLE, a tooltip pops up telling you what arguments the
function takes and what it returns. This is a useful quick reference so you don't have to remember
exactly what parameters a function takes, and it's easier than looking up the full reference online.
If you press the Ctrl key and the spacebar simultaneously, IDLE will attempt to autocom-
plete what you've typed thus far, which is useful if you can't remember exactly what a func-
tion is called. To try this out, type pri and then press Ctrl + spacebar. You should see a list
of functions with print highlighted, as shown in Figure 2-8. Press the spacebar again to
have IDLE inish off the typing for you.
Figure 2-8:
Autocomplete of
the print
function in
IDLE.
Conditional Behaviour
Computer programs would be very dull if they always executed the same statements.
Luckily, programs can do diferent things depending on these conditional tests: equal (==),
 
Search WWH ::




Custom Search