MONT 105S, Spring 2009
Home | | Course Schedule | | Assignments | | Lecture NotesLaboratory 4
Problem 1:
You should use the program skeleton given below:
A sample session for the problem might look like the following:
Problem 2:
A sample session for the problem might look like the following:
What To Turn In. A printed listing of the lab programs.
Be sure that your name is in the program prologues comment section of the program.
Reminder. Be sure to save a copy of
each program on your
Due at the end of today's class
Write a Python program, named reverseString.py, that does the following:
# program reverseString.py
# your name and program description goes here.
#need some code here to enter a word or phrase
#need some code here to use a while loop to print out the word or phrase
#in reverse, one letter at a time.
Please enter a word or phrase: parrot
t
o
r
r
a
p
Write a Python program, named addOne.py, that does the following:
You should use the program skeleton given below:
# program addOne.py
# your name and program description goes here.
numberList = [] #Create an empty list
count = 0
#need a while loop here to ask for 5 integers and append them to numberList
#Use the form: numberList.append(myNumber) to append to the list
#need a while loop to print out each number in the list
#need a while loop here to add one to each number in the list
#need a while loop to print out each number in the updated list
Please enter an integer: 5
Please enter an integer: 7
Please enter an integer: 9
Please enter an integer: 11
Please enter an integer: 13
You entered:
5
7
9
11
13
Your updated list is:
6
8
10
12
14