Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def format_list(my_list):
- length_list = len(my_list)
- my_list = my_list[range(length_list)][::2]
- last_one = my_list.pop()
- my_list = ', '.join(my_list)
- last_one = 'and ' + last_one
- my_list = my_list + [last_one]
- return(my_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement