Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your preparation for the journey continues. All of you decided to make your own nicknames. Write a function that takes two strings: first and
Your preparation for the journey continues. All of you decided to make your own nicknames. Write a function that takes two strings: first and last name. It then returns a nickname as string constructed in the following way: First name is reversed and then every other character is taken (starting from index 0) Then every third character is taken from the last name (starting from index 0) The resulting characters are put together to create a nickname as a string, then return it. Note: If either first/last name is empty, you should still follow the instructions since you can take every 3rd character from an empty string (which just results in an empty string). def name_scramble (fname, lname): 111111 >>> name_scramble ("Marina", "Langlois") 'aiaLgi' >>> name_scramble ("") II) ' >>> name_scramble ("Sheldon", "Cooper"). 'nde SCp' 11 11
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