We have already been introduced to the input and print functions in Python, as well as the concept of the variable. Below is a simple greeter program. Notice I have included comments with the # sign. It is good practice to identify the program, and provide me a description, your name, and the date you created the program.

# Greeter Program

# Demonstrates print and input functions

# Matt Cole

# 9.18.16name = “Matt”

print (name)

print (“Hi ” , name)input(“\n\nPress the key to exit.”)

The above code would produce the following:

While nice, we would also like to add some additional math in our program. The video below covers some mathematical operators and expands on the greeter program, into an age difference program.

Here is an example for the formula Fahrenheit to Celsius.

# Demonstrates Fahrenheit to Celsius formula

# Matt Cole

# 9.18.16F = 98.6

answer = (F – 32) * (5/9)print (answer)

When ran, we get the answer 37.0.