Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How can I better explain this code. I was able to solve the problem. But I'm trying to teach myself how to better write explainable

How can I better explain this code. I was able to solve the problem. But I'm trying to teach myself how to better write explainable step by step comments on how I solved each problem. Can someone help me with a better way to explain this code and also, a more elegant way to write this code.

image text in transcribed

image text in transcribed

1 \#It's a well-known and indisputable fact that if you want 2 \#to make your name sound fancy, you should list it as only 3 \#your first two initials followed by your last name. For 4 \#example, my full name is David Andrew Joyner, and therefore 5 \#my fancy name is D. A. Joyner. (If you have two middle names, 6 \#it's even better, but we'11 assume we have only one .- we're 7 \#C. 5. Lewis, not J. R. R. Tolkien). 8 \# [Executed at: Tue Dec 20 1:32: 13 PST 2022] 9 \#Write a function called fancy me, fancy me should take as Well done! You can see the ful 10 \#input a list of strings, each representing a full name (e.g: 11 \#"David Andrew Joyner" or "First Middle Last". fancy_me should 1 results of your submission b 12 \#return a single string, formatting that list of names in this y selecting full_results.txt f 14 \# F. N. Last, 0. A. Joyner, G. P. Burdel1 16 \# fulleresults. tot to 17 \#Each individual name is the first initial, then a period, then 18 r space, then the second initial, then a period, then a space, 19 then the last name, then a comma. There is no comma after the You might also find some sampl e_answer files in the drop dow n with other answers to this p 20 \# last name in the 11 ist. roblem. If they are available, we recommend reading them to 5 ee some optimal approaches! 21 \# "or mample: 22 \#For example: 23 \# 24 \# fancy mine(["First Middle Last", "David Andreu Joyner", "George P Eurdel1"]) 25 \# 26 \#...would return "f, 27 28 29 \#urite your function b 30 def fancy me(strings): FancyNames.py

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

Step: 3

blur-text-image

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

Database Support For Data Mining Applications Discovering Knowledge With Inductive Queries Lnai 2682

Authors: Rosa Meo ,Pier L. Lanzi ,Mika Klemettinen

2004th Edition

3540224793, 978-3540224792

More Books

Students also viewed these Databases questions

Question

what is a single instance variable

Answered: 1 week ago