Question: Data Programming / Python 1 Define last_letters up here! 2 3 def main(): last_letters('Ani, Trevor, Karen, Jasmine, Ryan') 5 last_letters Write a function named last_letters
1 Define last_letters up here! 2 3 def main(): last_letters('Ani, Trevor, Karen, Jasmine, Ryan') 5 last_letters Write a function named last_letters that takes a str as a parameter containing a sequence of names separated by commas, and prints the last letter of each name. For example, if we were to make the following call: nanes Ant. Trevor, Karen, Jasmine Hyan Last Letters(nanes) It should print 7 if __name__ '_main__': 8 main() You shouldn't make assumptions about the length of the given str or its composition. If the given str is empty, it should print nothing. If one of the names is empty (e.g. 'Ece,, Dylan), it should print an empty line for the name with no characters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
