Click on the image to get to the download page
Writing your first python programs
Basic Instructions 2:
Write a program, YI_BasicInstructions2.py with the following:
- Prompt the user for name and grade
- Reply with a message about the name and grade
- Assign the value of “54” to variable “x”
- Assign the value of “23” to variable “y”
- Display the result of multiplying the two variables with a message
- Prompt the user for two more numbers, find the sum of the two numbers and display the result in a message.
- 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:
- Asking for a number: input
- Storing a number
- Comparing a number
- Repeating the process: copy and paste?????
- 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"
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.