Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 6 . 3 . 6 Last Names = = = = = = = = = = = = = = = = =
Exercise 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 listmethod that returns a list, you can get the th thing in the resulting list like this:
xlistmethod
Hint #: 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 splitnamelistsalist:
return
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