Question

In: Computer Science

Write a program that uses Python List of strings to hold the five student names, a...

Write a program that uses Python List of strings to hold the five student names, a Python List of five characters to hold the five students’ letter grades, and a Python List of four floats to hold each student’s set of test scores. The program should allow the user to enter each student’s name and his or her four test scores. It should then calculate and display each student’s average test score and a letter grade based on the average. Input Validation: Do not accept test scores less than 0 or greater than 100.

Solutions

Expert Solution

names=[]
grades=[]
marks=[]
for i in range(5):
f=0
names.append(input("Enter students name:"))#read name of student
temp=[]
while True:
print("Enter test scores:")
temp=[]
for j in range(4):#read 4 scorees
temp.append(int(input()))
if temp[-1]<0 or temp[-1]>100:#check if score is valid or not
print("Enter valid scores")
f=1
break
if f==1:
f=0
continue
else:
marks.append(temp)
break
  
a=(sum(marks[-1])/len(marks[-1]))#get average of scores
print("Average test score is :",a)
if a>90:
grades.append("A")#based on average append grade to list
elif a>80:
grades.append("B")
elif a>70:
grades.append("C")
elif a>60:
grades.append("D")
elif a>50:
grades.append("E")
else:
grades.append("F")
for i in range(5):
print(names[i]," ",marks[i]," ",grades[i])#print names,marks list,grade

Screenshots:

The screenshots are attached below for reference.

Please follow them for output and proper indentation.



Related Solutions

Using LIST and FUNCTION Write a program in Python that asks for the names of three...
Using LIST and FUNCTION Write a program in Python that asks for the names of three runners and the time it took each of them to finish a race. The program should display who came in first, second, and third place.
Write a program in python to read from a file the names and grades of a...
Write a program in python to read from a file the names and grades of a class of students to calculate the class average, the maximum, and the minimum grades. The program should then write the names and grades on a new file identifying the students who passed and the students who failed. The program should consist of the following functions: a) Develop a getGrades() function that reads data from a file and stores it and returns it as a...
Python 8.17 LAB: Strings of a Frequency Write a program that reads whitespace delimited strings (words)...
Python 8.17 LAB: Strings of a Frequency Write a program that reads whitespace delimited strings (words) and an integer (freq). Then, the program outputs the strings from words that have a frequency equal to freq in a case insensitive manner. Your specific task is to write a function wordsOfFreqency(words, freq), which will return a list of strings (in the order in which they appear in the original list) that have a frequency same as the function parameter freq. The parameter...
Write a Python function that takes two parameters: the first a list of strings and the...
Write a Python function that takes two parameters: the first a list of strings and the second a single string. The function should return True or False depending on whether the string is in the list or not. For example, if the list contains eggs, milk, bananas, and the second parameter is pumpkin, the function should return False. Thank you.
Write a Python function that takes two parameters: the first a list of strings and the...
Write a Python function that takes two parameters: the first a list of strings and the second a single string. The function should return True or False depending on whether the string is in the list or not. For example, if the list contains eggs, milk, bananas, and the second parameter is pumpkin, the function should return False. Thank you.
Write a program in C++ that will make changes in the list of strings by modifying...
Write a program in C++ that will make changes in the list of strings by modifying its last element. Your program should have two functions: 1. To change the last element in the list in place. That means, without taking the last element from the list and inserting a new element with the new value. 2. To compare, you need also to write a second function that will change the last element in the list by removing it first, and...
Write a program in python such that There exists a list of emails List Ls =...
Write a program in python such that There exists a list of emails List Ls = ['[email protected]','[email protected]','[email protected]','[email protected]',[email protected]'] Count the number of emails IDS which ends in "ac.in" Write proper program with proper function accepting the argument list of emails and function should print the number of email IDs and also the email IDS ending with ac.in output 2 [email protected] [email protected] ================================= i am trying like this but getting confused len [True for x in Ls if x.endswith('.ac.in')] please write complete...
Create an array list (names) that will hold the names of several hall of fame soccer...
Create an array list (names) that will hold the names of several hall of fame soccer players. 2. Place your name on the screen as the master recorder:              “Master Hall of Fame Recorder: John Paul Jones” 3. Ask the user how many names they would like to record. (input 5 when the program runs) 4. Create a loop that will ask for the “Hall of fame member #1: “, etc Add in the following names: Pele Rooney Maradona Messi...
Write a C program that creates and prints out a linked list of strings. • Define...
Write a C program that creates and prints out a linked list of strings. • Define your link structure so that every node can store a string of up to 255 characters. • Implement the function insert_dictionary_order that receives a word (of type char*) and inserts is into the right position. • Implement the print_list function that prints the list. • In the main function, prompt the user to enter strings (strings are separated by white-spaces, such as space character,...
Write a python program that keeps names and email addresses in a dictionary as key-value pairs....
Write a python program that keeps names and email addresses in a dictionary as key-value pairs. The program should display a menu that lets the user look up a person’s email address, add a new name and email address, change an existing email address, and delete an existing name and email address. The program should bind the dictionary and save it to a file when the user exits the program. Each time the program starts, it should retrieve the dictionary...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT