Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON Data: three dictionaries I have calculated the file for each student, the average of their grades, and their final grade Question: Create a function

PYTHON

Data: three dictionaries

I have calculated the file for each student, the average of their grades, and their final grade

Question:

Create a function that, given the final grades allready calculated: If score is 90 or above: return "A" , if score is 80 or above: return "B" , if score is 70 or above: return "C" ,if score is 60 or above: return "D", Otherwise: return "F"

image text in transcribed

image text in transcribed

lloyd = { "name" : "Lloyd" "homework" : [ 90.0, 97.0, 75.0 , 92.0 ], "quizzes" : [ 88.0 , 40.0 , 94.0 ], "tests" : [ 75.0, 90.0 ] } alice { "name" : "Alice" "homework" : [ 100.0 , 92.0, 98.0 , 100.0 ] , "quizzes" : [ 82.0, 83.0 , 91.0 ] , "tests" : [ 89.0 , 97.0 ] } tyler = { "name" : "Tyler" "homework" : [ 0.0 , 87.0, 75.0 , 22.0 ] , "quizzes" : [ 0.0, 75.0 , 78.0 ], "tests" : [ 100.0, 100.0 ] } estudiantes=[lloyd, alice, tyler] def ficha(estudiantes): #file of each student for estudiante in estudiantes: print("Nombre:", estudiante["name"]) print ("Homework:", estudiante["homework"]) print ("Quizzes:", estudiante["quizzes"]) print ("Tests:", estudiante["tests"]) ficha(estudiantes) def media (estudiantes): for estudiante in estudiantes: print("Nombre:", estudiante["name"]) hw = 0 for mark in estudiante["homework"]: hw += mark print ("Homework:", hu/len(estudiante["homework"])) 9 = for mark in estudiante["quizzes"]: 9 += mark print ("Quizzes:", q/len(estudiante["quizzes"])) t = 0 for mark in estudiante["tests"]: t += mark print ("Tests:", t/len(estudiante["tests"])) media (estudiantes) def nota_final(estudiantes): #final gradel for estudiante in estudiantes: print("Nombre:", estudiante["name"]) hw = 0 nota_final 9 = t = 0 for nota in estudiante["homework"]: hw += nota nota_final += (hw/(len(estudiante["homework"])*100)) * 10 for nota in estudiante["quizzes"]: 9 += nota nota_final += (9 / (len (estudiante["quizzes"]) * 100)) * 30 for nota in estudiante["tests"]: t += nota nota_final += (t / (len(estudiante["tests"]) * 100)) * 60 print("Nota final :", nota_final)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

Briefly explain the various types of leadership ?

Answered: 1 week ago

Question

Explain the need for and importance of co-ordination?

Answered: 1 week ago

Question

Explain the contribution of Peter F. Drucker to Management .

Answered: 1 week ago

Question

What is meant by organisational theory ?

Answered: 1 week ago