Could you help me create a python code for this question? Thanks
Consider a list for storing 25 students GPA
You can use in-built function or you can also write a simple code to find average.
Here, we will show how to write the code to find average without using in built function
gpaList=[]; #declare a list
print("Enter GPA's of 25 students "); #print message to enter inputs
for i in range(25): #for 25 times range() function will start from 0 and goes till 25 with step 1
gpaList.append(input()); #append the input value to list
sumOfGPAs=0; #variable to store sum of all GPA's
for element in gpaList: #for each and every element in list
sumOfGPAs=sumOfGPAs+float(element); #the input() will return string, so it is to be parsed to number and then added to sum
averageOfGPAs=sumOfGPAs/25; #calculate average by dividing sum by 25
print("The average GPAs of 25 students is: ",averageOfGPAs); #print averageOfGPAs
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- For this question you must design and implement a postcondition loop in Python that will display the following numbers (one on each line) to the terminal: 29, 41, 53, 65, 77, 89, 101, 113, 125, 137, 149, 161, 173, 185, 197, 209, 221, 233, 245, and 257. Although a counter-controlled loop is ideal for this task, you are not permitted to use a FOR loop in your program - you must use a postcondition loop that has been implemented using WHILE instead.Furthermore, your postcondition loop must be implemented using a Boolean flag variable.arrow_forwardPlease solve this question in pythonarrow_forwardPlease can you show this in Pythonarrow_forward
- I'm interested in studying Python, therefore I'd appreciate it if you could point me in the right way.arrow_forwardCan you write a python code for a Barcode_Generator algorithm which would be used to generate barcodes for images?arrow_forwardplease help me by giving me a few ideas (do not write the code for me please) for a python code that includes all the following: Strings Int and Floats ,Inputs,Definitions, Conditionals ,Match Statements & Modulo ,Loops ,Lists and Dictionaries ,Error Handling ,Libraries ,Testingarrow_forward
- Working on program #2 this is what I have so far but it keeps saying my turtle is undefined. Can anybody help?arrow_forwardThis question is for Python. Thank you!arrow_forwardSince I'm interested in picking up some Python, it would be really helpful if you could point me in the right path and give me some specific advice.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY