Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 6 . 3 . 6 Last Names = = = = = = = = = = = = = = = = =

Exercise 6.3.6 Last Names
=========================
In this exercise, you will start with the following list of names:
names =[
"Maya Angelou",
"Chimamanda Ngozi Adichie",
"Tobias Wolff",
"Sherman Alexie",
"Aziz Ansari"
]
Use a list comprehension to print a list of just the last names.
Hint: You can use an index not only on a list variable, but also on an expression that returns a list!
So if x has a method called list_method that returns a list, you can get the 0th thing in the resulting list like this:
... x.list_method()[0]...
Hint #2: You'll need to use the split method!
Last names are the last part of the name.
"""
names =["Maya Angelou","Chimamanda Ngozi Adichie","Tobias Wolff","Sherman Alexie","Aziz Ansari"]
# Your code here...
def split_name_lists(a_list):
return

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

Students also viewed these Databases questions