splitting output lists from a dictionary

Replace your last for loop with this for loop:

for key,val in programme.items():
    val_to_print = '\n '.join(val)
    print(f"{key} Coder(s) \n {val_to_print}")

Output:

Python Coder(s) 
 Anne
 Tim
Java Coder(s) 
 Sue

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top