Answered step by step
Verified Expert Solution
Link Copied!

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

image

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

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing a business risk appraoch

Authors: larry e. rittenberg, bradley j. schwieger, karla m. johnston

6th Edition

9780324645095, 324645090, 978-0324375589

More Books

Students also viewed these Programming questions