Question

In: Computer Science

Python Programming- Practice Lists & Tuples B #This is a template for practicing mutability and conversion...

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]!

Solutions

Expert Solution

Here i solve some of your problem


Related Solutions

Python Programming- 9.11 S80 MT Practice1 #This is a template for practicing mutability and conversion #Create...
Python Programming- 9.11 S80 MT Practice1 #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: 88.5, 90, 75, 70, 85.6 #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...
Using Python In this assignment we will try to add tuples, lists, if statements and strings...
Using Python In this assignment we will try to add tuples, lists, if statements and strings to our program. For example, you can ask for a user for a couple items, their name and age – and depending on their age, print out a predefined list. You could ask for some string input and decide to do something with the output. You could ask for three items, 1) age, 2) are you a male or female and 3) are your...
Starting out with python Lists and Tuples - US Population Data In this assignment, you will...
Starting out with python Lists and Tuples - US Population Data In this assignment, you will be reading the contents of a file into a list. This file contains the midyear population of the United States, in thousands, during the years 1950 through 1990. The first line in the file contains the population for 1950, the second line contains the populations for 1951, and so forth. You will ask the user to input a specific year to check the population...
Describe how tuples can be useful with loops over lists and dictionaries, and give Python code...
Describe how tuples can be useful with loops over lists and dictionaries, and give Python code examples. Create your own code examples. Do not copy them from the textbook or any other source. Your descriptions and examples should include the following: the zip function, the enumerate function, and the items method.
how to use subsetting in Python lists. Practice making subsets of the namelist. import matplotlib.pyplot as...
how to use subsetting in Python lists. Practice making subsets of the namelist. import matplotlib.pyplot as plot # set up your lists numlist = [8, 6, 5, 3] namelist = ['freshmen', 'sophomores', 'juniors', 'seniors'] colorlist = ['red', 'green', 'pink', 'yellow' ] explodelist = [0.1, 0.0, 0.0, 0.0] # make the pie chart plot.pie(numlist, labels=namelist, autopct='%.2f%%', colors=colorlist,         explode = explodelist, startangle = 90) plot.axis('equal') plot.savefig('piechart.png')
Python Practice Sample: Generate lists containing the numbers between 1 and 50 as follows:  same...
Python Practice Sample: Generate lists containing the numbers between 1 and 50 as follows:  same is a list of all the two-digit numbers whose digits are the same (11, 22, etc.)  addsto6 is a list of all numbers the sum of whose digits is 6  rest contains the rest of the numbers. A number can appear only in one of the lists; with same having higher priority. (So for example, 33 would appear in the same, but...
[Python programming] Functions, lists, dictionary, classes CANNOT BE USED!!! This assignment will give you more experience...
[Python programming] Functions, lists, dictionary, classes CANNOT BE USED!!! This assignment will give you more experience on the use of: 1. integers (int) 2. floats (float) 3. conditionals(if statements) 4. iteration(loops) The goal of this project is to make a fictitious comparison of the federal income. You will ask the user to input their taxable income. Use the income brackets given below to calculate the new and old income tax. For the sake of simplicity of the project we will...
"Python lists are power data structures. Describe some of the benefits of Python lists" Answer the...
"Python lists are power data structures. Describe some of the benefits of Python lists" Answer the question above in a few sentences.
"Python lists are power data structures. Describe some of the benefits of Python lists" Make sure...
"Python lists are power data structures. Describe some of the benefits of Python lists" Make sure you don't just give me a list but a few sentences instead just answering it.
PYTHON...... Working with lists, functions, and files Objective: Work with lists Work with lists in functions...
PYTHON...... Working with lists, functions, and files Objective: Work with lists Work with lists in functions Work with files Assignment: Part 1: Write a program to create a text file which contains a sequence of test scores. Ask for scores until the user enters an empty value. This will require you to have the scores until the user enters -1. After the scores have been entered, ask the user to enter a file name. If the user doesn’t not enter...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT