Python Language Dictionary The trailing comma

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Like lists and tuples, you can include a trailing comma in your dictionary.

role = {"By day": "A typical programmer",
        "By night": "Still a typical programmer", }

PEP 8 dictates that you should leave a space between the trailing comma and the closing brace.



Got any Python Language Question?