Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dictionnary
#1
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
Reply
#2
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dictionnary indexing error Ander 6 1,874 Sep-10-2021, 12:22 PM
Last Post: Ander
  python dictionnary Omar_Yatim 3 2,810 Dec-08-2019, 05:12 AM
Last Post: scidam
  Dictionnary brackets issue Reldaing 1 1,822 Nov-10-2019, 11:54 PM
Last Post: ichabod801
  Access to the elements of a dictionnary Reims 1 1,624 Oct-02-2019, 12:48 PM
Last Post: SheeppOSU
  from Json Time Serie file to python dictionnary Reims 1 2,021 Sep-11-2019, 08:17 AM
Last Post: DeaD_EyE
  convert a json file to a python dictionnary of array Reims 2 2,236 Sep-10-2019, 01:08 PM
Last Post: Reims
  Why do we need setdefault() method for dictionnary? DJ_Qu 3 2,695 Apr-21-2019, 11:00 AM
Last Post: Gribouillis
  Json dictionnary on Redis katsu707 1 2,425 Dec-04-2018, 11:59 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020