In: Computer Science
Python Programming- Practice Lists & Tuples B
#This is a template for practicing mutability and
conversion
#Create and assign the following list of numbers to a list data
type and variable name: 99.9,88.7,89,90,100
#convert the list to a tuple and assign the tuple a different
variable name
#Ask the user for a grade and convert it to a float type (no
prompt) and assign it to a new variable name
#append the user entered grade to the list
#update the tuple to reflect the user entered grade (Tip, replace
the entire tuple with the list converted to a tuple)
#compute the current average grade using the tuple
#Display the average that you calculated in the previous line using
the following format:
#Your current grade is: [calculated average}. (Tip: use the +
concatenator and convert the average to a string)
#Ask the user for another grade (no prompt), convert it to an
integer and assign it to a new variable name
#replace the fourth grade in the list with the most recently
entered grade (Tip, you'll need to use the index)
#remove the fifth grade from the list (Tip, you'll need to use the
index and the pop method)
#update the tuple to reflect these recent changes to the list (Tip:
replace the entire tuple with the converted list)
#compute the current average grade using the tuple (Tip: divide the
tuple sum by the tuple length)
#Display the latest average that you calculated in the previous
line using the following format:
#Your updated grade is: [calculated average}. (Tip: use the +
concatenator and convert the average to a string)
#Display the following statement using the + concatenator using the
latest values for sum, length and average:
#(Tip: make sure all the three variables have been converted to
strings)
#With a sum of [sum of tuple] for [length of tuple] assignments
your grade is [tuple average]!