13th March 2021, 03:42 AM
|
Member
|
|
Join Date: Jan 2019
Posts: 14
|
|
Shaun: try colour like this?
a_res = **** "1st":'darkgreen', "2nd":'gold', "3rd":'blue', "4th":'purple' ****
colour = 'black'
if res in a_res:
colour = a_res[res]
key error happens if your key is not in the dictionary.
|