Basic: BasicInstructions.py – BasicInstructions2/3.py and greetings.py

Click on the image to get to the download page
Screen Shot 2014-09-09 at 9.30.37 AM

Writing your first python programs

Basic Instructions 2:

Write a program, YI_BasicInstructions2.py with the following:

  1. Prompt the user for name and grade
  2. Reply with a message about the name and grade
  3. Assign the value of “54” to variable “x”
  4. Assign the value of “23” to variable “y”
  5. Display the result of multiplying the two variables with a message
  6. Prompt the user for two more numbers, find the sum of the two numbers and display the result in a message.
  7. Prompt the user for two more numbers, find the smallest and display it with a message.

Basic Instructions 3:
Write a program, YI_BasicInstructions3.py with the following:

  1. Asking for a number: input
  2. Storing a number
  3. Comparing a number
  4. Repeating the process: copy and paste?????
  5. Find the min
yesNo = "y"
while yesNo == "y":
    inputX = input("Enter an integer ")
            # 1. asking for a number: input and store the
            #  number in variable x
    x = int(inputX) # convert input to integer
    inputY = input("Enter another integer ")
            # 1. asking for another number: input and
            # store the number in variable y
    y = int(inputY) # convert input to integer
    if x > y:
         print (x, " is bigger than ", y)
    else:
         print (y, " is bigger than ", x)
    yesNo = input("Would you like to compare more numbers? y/n ")

print "Goodbye"

firstProgramFlowchart,,,,

Homework:
Write a python program, YI_greetings.py, to
1. prompt the user for name and grade
2. reply with, How are you feeling today, name?
3. reply with a comment about his or her grade using the name and he or she is feeling.