An Important Message

This exercise will show you how to create your first Python program. Make sure Python is installed, then type the following text in a new file. Save it into your pycode folder and call it firstprog.py.

firstprog.py
1
2
print("I am determined to learn Python.")
print("Today's date is ")

That's right! It is only two lines of code!

Once the code has been saved, open up a terminal window and change into the folder where you saved your code.

[:::]

Then run your Python code file through the Python interpreter like so:

[:::]

What You Should See

I am determined to learn Python.
Today's date is

Study Drills

  1. Change what is inside the quotes on line 2 to include today's date. Save the file once you have made your changes and run the file again.
  2. Change what is inside the quotes on line 1 to have the computer display your name.

What You Should See After Completing the Study Drills

[:::]
I, Graham Mitchell, am determined to learn Python.
Today's date is Sunday, February 19, 2017.



©2017 Graham Mitchell