Created
April 21, 2020 00:13
-
-
Save roman-on/9b4886f395aae089d8fe38459fda58ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| The function gets a list of strings of equal length. The function returns a string containing the list organs in paired positions, | |
| violated in the Warford comma, as well as the last limb with the caption and before. | |
| my_list = ["hydrogen", "helium", "lithium", "beryllium", "boron", "magnesium"] | |
| format_list(my_list) | |
| hydrogen, lithium, boron, and magnesium | |
| """ | |
| def format_list(my_list): | |
| a = my_list[::2] | |
| print (", ".join(a) + ", and", my_list[-1]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment