Question: Data Programming / Python Please do both answers for thumbs up Write a function named last_letters that takes a str as a parameter containing a

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: names = 'Ani, Trevor, Karen, Jasmine, Ryan' last_letters (names) It should print: i r ' L C 0 C n n 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. What is the value printed by the following slice? Formatting: Your output should not include quotes as print output doesn't display quotes around strs. PYTHON r1 LJ 1 game = 'Among Us! 2 print(game [2:-3:2])
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
