Jul-29-2019, 08:13 AM
Hi, I'm trying to understand dictionaries better.
My problem is I'm trying to dynamically alter a value inside of a dictionary with a value inside that same dictionary.
Thank you!
My problem is I'm trying to dynamically alter a value inside of a dictionary with a value inside that same dictionary.
demonspawn = { 'level': 1, 'xpreward': round(demonspawn['level']*1.5), 'str': round(demonspawn['level'] * 1.5), }
Error:File "line 3, in <module>
'xpreward': round(demonspawn['level']*1.5),
NameError: name 'demonspawn' is not defined
Error:Using variable demonspawn before assignment
Can anybody help me resolve this issue while also achieving my goal?Thank you!