{"id":514,"date":"2020-10-14T17:24:30","date_gmt":"2020-10-14T17:24:30","guid":{"rendered":"https:\/\/marshallbrain.com\/wordpress\/?page_id=514"},"modified":"2020-10-14T17:24:30","modified_gmt":"2020-10-14T17:24:30","slug":"python2","status":"publish","type":"page","link":"https:\/\/marshallbrain.com\/python2","title":{"rendered":"Marshall Brain’s Quick and Easy Python Tutorials – Chapter 2"},"content":{"rendered":"\n

by Marshall Brain<\/a><\/p>\n\n\n\n

In the first tutorial we learned how to write the simplest computer programs using the Python programming language. We learned how to create output<\/em> from a computer program. In this turotial we will learn about variables and input<\/em>. With input<\/em>, we can ask the user questions and use the answers to control our programs.<\/p>\n\n\n\n

Here is the simplest possible example. In Chapter 1 we wrote a program that printed “Hello World!” 20 times. What if we want to let the user control how many times “Hello World!” gets printed? It would look like this:<\/p>\n\n\n\n