Python Forum

Full Version: dictionnary
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I try to make a dict for my code, the dictionnary content the sqaure number and the the value of this square, the dict have 480 value. I need a simple method to create all the value. if I can add more value, I will do it. I have search for my answer, but I have find nothing to help me.
my code

top=0
end=0
valuesquare{}
    "valuesquare"top+end*30[32]
    top+1
    if end==15 and top==29:
        break
    elif top==29:
        end+1
        top==0
I'm sure I can optimize this, but I dosen't find how, and I'm pretty sure the code dosen't work
thank for the help
Sorry but your code doesn't make any sense.
read up on how to use dictionary's
https://docs.python.org/3/tutorial/datas...ctionaries
https://python-forum.io/Thread-Basic-Dictionaries