Question
# next the function gpa(courses) to calculate the GPA Python Coding Problem # It is acceptable syntax for list, dictionary, JSON and the likes to
# next the function gpa(courses) to calculate the GPA
Python Coding Problem
# It is acceptable syntax for list, dictionary, JSON and the likes to be spread over multiple lines.
courses = [
{ "class":"Intro to DS", "id":"DATS 6101", "semester":"spring", "year":2018, "grade":'B-', "credits":3 } ,
{ "class":"Data Warehousing", "id":"DATS 6102", "semester":"fall", "year":2018, "grade":'A-', "credits":4 } ,
{ "class":"Intro Data Mining", "id":"DATS 6103", "semester":"spring", "year":2018, "grade":'A', "credits":3 } ,
{ "class":"Machine Learning I", "id":"DATS 6202", "semester":"fall", "year":2018, "grade":'B+', "credits":4 } ,
{ "class":"Machine Learning II", "id":"DATS 6203", "semester":"spring", "year":2019, "grade":'A-', "credits":4 } ,
{ "class":"Visualization", "id":"DATS 6401", "semester":"spring", "year":2019, "grade":'C+', "credits":3 } ,
{ "class":"Capstone", "id":"DATS 6101", "semester":"fall", "year":2019, "grade":'A-', "credits":3 }
]
def find_gpa(courses):
# write an appropriate and helpful docstring
total_grade_point_credit =0 # initialize
total_credits =0 # initialize
# ?????? fill in your codes here
# gpa = ?????
return gpa
# Try:
print(" %.2f " % find_gpa(courses) )
# What is the input (function argument) data type for find_gpa?
# What is the output (function return) data type for find_gpa(courses) ?
###################################### Q4 ############################### # next the function gpa(courses) to calculate the GPA # It is acceptable syntax for list, dictionary, JSON and the likes to be spread over multiple lines. courses = [ { "class":"Intro to DS", "id":"DATS 6101", "semester":"spring", "year":2018, "grade" : 'B-', "credits":3 } , { "class":"Data Warehousing", "id": "DATS 6102", "semester":"fall", "year":2018, "grade" : 'A-', "credits":4} , { "class":"Intro Data Mining", "id":"DATS 6103", "semester":"spring", "year":2018, "grade":'A', "credits":3} , { "class":"Machine Learning I", "id":"DATS 6202", "semester":"fall", "year":2018, "grade" : 'B+', "credits":4 } , { "class":"Machine Learning II", "id":"DATS 6203", "semester":"spring", "year":2019, "grade" : 'A-', "credits":4}, { "class":"Visualization", "id":"DATS 6401", "semester":"spring", "year":2019, "grade" : 'C+', "credits":3 } , { "class":"Capstone", "id":"DATS 6101", "semester":"fall", "year":2019, "grade" : 'A-", "credits":3} def find gpa (courses): # write an appropriate and helpful docstring total_grade_point_credit =0 # initialize total_credits =0 # initialize # ?????? fill in your codes here # gpa = ????? return gpa # Try: print(" %.2f " % find_gpa(courses) ) # What is the input (function argument) data type for find_gpa? # What is the output (function return) data type for find_gpa(courses)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started