Users interacting with your program

We just built a function that adds two numbers together. Learning to make a program that does math is interesting, but our function is limited because our addition() function needs to have variables changed manually to calculate results for different numbers.

What if there was a way to get information from the user and store THAT information in a variable so that it could be used by addition or subtraction functions each time? Anyone who has used a calculator of any kind already knows that this is possible. Python has a function called raw_input() that allows us to tell the program to ask the user a question. The raw_input() function is incredibly useful. We can get every kind of information from the user this ...

Get Python Projects for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.