edit: the second link solved my problem, thank you!
I have a global variable "messages", my keys will be "channel" and my values will be "message"
I have tried:
messages = {}
if channel not in messages:
messages[channel] = message
else:
messages[channel].append(message)
and:
messages = {}
if channel not in messages:
messages[channel][0] = message
else:
messages[channel].append(message)
How do I create a new dictionary key and append values to it?
I'm sorry if this is a repeat question, I looked hard but I couldn't figure it out.