Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[PYTHON] A students: This function takes a connection object, a table name with default value ISTA 131 F17, a class standing string with default value
[PYTHON]
A students: This function takes a connection object, a table name with default value "ISTA 131 F17", a class standing string with default value None, and a maximum number of results to return with default value 10. This function returns a list containing the names of the students that got A's up to the specified maximum number (it may be less if there aren't that many in the table) in the format "last, first". If the class argument is None, take the students from the whole table, otherwise just from students with the specified class standing. Your query should be case insensitive regarding the class standing. Within in the group, sort on the names. Don't pull all of the data into Python and then do the logic there, do it with properly constructed queries. You may have two queries, one that executes if class standing is None; the other if it is either 'freshman', 'sophomore', etc. Here is something to get you started: make 2 queries and pick which one to use depending on whether a standing was passed c.execute (query) return [row[0] for row in c.fetchall()] A students: This function takes a connection object, a table name with default value "ISTA 131 F17", a class standing string with default value None, and a maximum number of results to return with default value 10. This function returns a list containing the names of the students that got A's up to the specified maximum number (it may be less if there aren't that many in the table) in the format "last, first". If the class argument is None, take the students from the whole table, otherwise just from students with the specified class standing. Your query should be case insensitive regarding the class standing. Within in the group, sort on the names. Don't pull all of the data into Python and then do the logic there, do it with properly constructed queries. You may have two queries, one that executes if class standing is None; the other if it is either 'freshman', 'sophomore', etc. Here is something to get you started: make 2 queries and pick which one to use depending on whether a standing was passed c.execute (query) return [row[0] for row in c.fetchall()]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