Python Forum
I need help with my code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need help with my code
#4
you are really doing strange stuff here.

1. you need to define functions before you can call them. (i.e. lines starting from 32 should be before you try to call them (i.e. before current line 9)
2. No indentation is needed - I don't know why you indent each of these functions further and further
3. line 29 mainMenu(): - no need od :
4. line 30 - except should be at same level as try
5. maybe the biggest problem with your code is repetition. This is indicative you need to refactor your code. Hint: - you can have the patient name as key and their birthday as value in a dictionary. This assume no repeating names. Or you can find more suitable data structures like namedtuple to hold patient information and access it from single function.
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
I need help with my code - by pasteldreams - Mar-13-2020, 09:46 AM
RE: I need help with my code - by buran - Mar-13-2020, 10:06 AM
RE: I need help with my code - by pasteldreams - Mar-13-2020, 10:36 AM
RE: I need help with my code - by buran - Mar-13-2020, 10:51 AM

Forum Jump:

User Panel Messages

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