+ 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!

17th Jan 2020, 5:23 PM
Anthony B.
Anthony B. - avatar
4 Respuestas
+ 6
Works with f-string too message = f"Good afternoon { ', '.join(friends_list) }."
17th Jan 2020, 5:39 PM
Ipang
+ 3
Thanks Ipang!
17th Jan 2020, 6:05 PM
Anthony B.
Anthony B. - avatar
+ 3
You're welcome buddy 👌
17th Jan 2020, 6:07 PM
Ipang
+ 1
Thanks Alexandr! Worked like a charm.
17th Jan 2020, 5:37 PM
Anthony B.
Anthony B. - avatar