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)     '''

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 3PE
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L