Python: if possible answers in one line of code def name_sort(staff):     '''     Question 2     You are given a list of Georgia Tech staff members- each with a first and last name separated by a space,     and need to sort them alphabetically by last name for a directory. However, the person who provided you the list     did not proofread the records and accidentally misspelled some of the names. You can identify which ones     have typos just by looking at the first letter of the first name.         - First, sort the list alphabetically by the last name.         - Remove any members whose first name starts with "Q" or "X".         - Return the resulting list.     Args:         staff (list)     Returns:         list     >>> name_sort(['Damon Williams', 'Xngel Cabrera', 'George Burdell', 'Brett Key', 'David Joyner', 'Qon Lowe'])         ['George Burdell', 'David Joyner', 'Brett Key', 'Damon Williams']     ''' # print(name_sort(['Damon Williams', 'Xngel Cabrera', 'George Burdell', 'Brett Key', 'David Joyner', 'Qon Lowe'])) # print(name_sort(['Melinda McDaniel', 'Buzz Yellowjacket', 'Josh Pastner', 'Nell Fortner', 'Michelle Collier']))     def gpa_manipulation(gpa_list):     '''     Question 3     You are working in the registrars office and have a been given a list of the average gpas of     each of the colleges at Georgia Tech: Scheller, College of Engineering, College of Design,     College of Computing, Ivan Allen, College of Sciences.     NOTE: GPA's are made up and in no particular order     - First, one of the GPA's is None. Replace None with       the 3.80.     - Second, reverse the order of the list you are given.       This should not be sorted simply reversed from the way       you were given them     - Third, change the type of the list to a tuple     Args:         gpa_list (list)     Returns:         tuple     >>> gpa_manipulation([3.72, 3.25, 3.43, 2.99, None, 3.87])         (3.87, 3.80, 2.99, 3.43, 3.25, 3.72)     '''

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

   

Python: if possible answers in one line of code

def name_sort(staff):
    '''
    Question 2
    You are given a list of Georgia Tech staff members- each with a first and last name separated by a space,
    and need to sort them alphabetically by last name for a directory. However, the person who provided you the list
    did not proofread the records and accidentally misspelled some of the names. You can identify which ones
    have typos just by looking at the first letter of the first name.

        - First, sort the list alphabetically by the last name.
        - Remove any members whose first name starts with "Q" or "X".
        - Return the resulting list.

    Args:
        staff (list)
    Returns:
        list

    >>> name_sort(['Damon Williams', 'Xngel Cabrera', 'George Burdell', 'Brett Key', 'David Joyner', 'Qon Lowe'])
        ['George Burdell', 'David Joyner', 'Brett Key', 'Damon Williams']

    '''

# print(name_sort(['Damon Williams', 'Xngel Cabrera', 'George Burdell', 'Brett Key', 'David Joyner', 'Qon Lowe']))
# print(name_sort(['Melinda McDaniel', 'Buzz Yellowjacket', 'Josh Pastner', 'Nell Fortner', 'Michelle Collier']))

 

 

def gpa_manipulation(gpa_list):
    '''
    Question 3
    You are working in the registrars office and have a been given a list of the average gpas of
    each of the colleges at Georgia Tech: Scheller, College of Engineering, College of Design,
    College of Computing, Ivan Allen, College of Sciences.

    NOTE: GPA's are made up and in no particular order

    - First, one of the GPA's is None. Replace None with
      the 3.80.

    - Second, reverse the order of the list you are given.
      This should not be sorted simply reversed from the way
      you were given them

    - Third, change the type of the list to a tuple

    Args:
        gpa_list (list)
    Returns:
        tuple

    >>> gpa_manipulation([3.72, 3.25, 3.43, 2.99, None, 3.87])
        (3.87, 3.80, 2.99, 3.43, 3.25, 3.72)

    '''
    

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Header Files
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education