List Items - Cleaning Up the List | SoloLearn: Learn to code for FREE!

+4

List Items - Cleaning Up the List

Good Morning Everyone, I am trying to print a message without the apostrophes and brackets. The desired output is as follows: Good afternoon Tom, Andrew, Eric, Dale. The code is below: friends_list = ['Tom', 'Andrew', 'Eric', 'Dale'] message = f"Good afternoon {friends_list}." print(message) What am I doing wrong here? Thanks in advance!

1/17/2020 5:23:52 PM

Anthony B.

5 Answers

New Answer

+6

Works with f-string too message = f"Good afternoon { ', '.join(friends_list) }."

+3

Thanks Ipang!

+3

You're welcome buddy 👌

+1

Thanks Alexandr! Worked like a charm.

+1