Project 2: Basic User Input

--Originally published at TEC GDL 2016

For the second program I chose to build directly on the basic output covered in the first tutorial. This is why I chose to dig deeper into one of the mastery topics called Basic User Input. Here, I learned how to run a program that allows the user to enter their own information.

The first basic input was to programm the possibility of entering a name. This can be done by typing:
person= input(‘Welcome, please enter your name:’)
print(‘Thank you’, person)
– By typing this, the program will then give the output: Thank you, (e.g.) James.

So basically, I decided the term “person” to be taking on the different names to be entered into the system. In the next step I added the input of age into the Atom window. This way it is easily possible to build up a conversation with the person who enters the program. I could do this further and add further variables for the basic input but this gives quite a good overview on the topic already.

Bildschirmfoto 2016-08-22 um 11.02.15

Additionally, here is a quick explanation to all of you on how to open the files through the terminal on a Mac:
– Create a draft & edit it whenever you want.
– Save it to any directory (I always choose desktop for the sake of simplicity)
– Open ‘Terminal’ on Mac
– Type ‘cd’ (short for change directory) + ‘Desktop’ (the directory where you saved the draft)
– Type ‘python3 ____’, where ____ should be the file name
– Terminal runs the program

Bildschirmfoto 2016-08-22 um 11.02.52

Sources:

http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/io.html