Lab–4–String and List Manipulation
Exercise 1 of Chapter 8
reverse = “backward”
input (“traversal string”)
index = -1
while index < len ( reverse ):
letter = reverse [ index ]
print (letter)
index = index – 1
Exercise 3 of Chapter 10
values = [ int(), int() , int()]
values[0] = int ( input (“first value?\n”))
values[1] = int ( input (“second value?\n”))
values[2] = int ( input (“third value?\n”))
addition = [values[0], values[0] + values[1], values[0] + values[1] + values[2]]
print (values)
print (addition)
Leave a Reply