April 2017
Beginner to intermediate
312 pages
7h 23m
English
Let's revisit the ID card example from Chapter 2, Arithmetic Operations, Loops, and Blinky Lights (input_test.py). We discussed writing a simple program that captures and prints the information belonging to a student. A student's contact information could be retrieved and stored as follows:
name = input("What is your name? ") address = input("What is your address? ") age = input("How old are you? ")
Now, consider a scenario where the information of 10 students has to be saved and retrieved at any point during program execution. We would need to come up with a nomenclature for the variables used to save the student information. It would be a clutter if we use 30 different variables to store information ...
Read now
Unlock full access