Python Forum
what function should i use to tidy up my code (extreme beginner)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what function should i use to tidy up my code (extreme beginner)
#2
that is example that you should keep information out if your variable names.
In this case you need to create a data structure, e.g. dict to hold your players.
Note that class name is better to be singular Player, not Players, i.e. it represent a single player
There are many other things that can be improved, but that is to answer your specific question
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: what function should i use to tidy up my code (extreme beginner) - by buran - Dec-16-2019, 02:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner: Code not work when longer list raiviscoding 2 900 May-19-2023, 11:19 AM
Last Post: deanhystad
  Putting code into a function breaks its functionality, though the code is identical! PCesarano 1 2,057 Apr-05-2021, 05:40 PM
Last Post: deanhystad
  Code not reading http link from .txt file (Beginner level) plarrip 3 2,493 Dec-17-2020, 11:33 PM
Last Post: bowlofred
  Beginner: I need help understanding few lines of a code. hop_090 1 1,740 Sep-07-2020, 04:02 PM
Last Post: Larz60+
  Beginner Code, how to print something after a number of turns (guessing game) QTPi 4 2,884 Jun-18-2020, 04:59 PM
Last Post: QTPi
  A beginner code... TheDude 7 3,384 Jun-18-2020, 05:39 AM
Last Post: TheDude
  [Beginner] Code is not producing desired result fakej171 2 2,497 Mar-21-2020, 10:26 AM
Last Post: buran
  Beginner at Python. Trying to count certain integer from random string of code kiaspelleditwrong 3 2,490 Oct-14-2019, 10:40 AM
Last Post: perfringo
  Beginner trying to code in python RA0211 1 1,888 Sep-26-2019, 11:10 AM
Last Post: emryscass
  Beginner problem, replace function with for loop Motley_Cow 9 4,780 Sep-13-2019, 06:24 AM
Last Post: Motley_Cow

Forum Jump:

User Panel Messages

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