Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if else statements
#6
The problem is that the code in OP - besides everything - is used to both to store list of stores (pun unintended) and actual stores. Class attributes mask the design flaw, creating an illusion of a working code.

In a properly designed implementation, Store class must contain a record of an individual store; container for stores may be another class, a dictionary or a list - but not the same class that contains the individual store record.
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
if else statements - by remy - Sep-14-2018, 10:05 AM
RE: if else statements - by Mekire - Sep-14-2018, 10:12 AM
RE: if else statements - by remy - Sep-15-2018, 03:48 AM
RE: if else statements - by volcano63 - Sep-15-2018, 02:51 PM
RE: if else statements - by ichabod801 - Sep-15-2018, 08:09 PM
RE: if else statements - by volcano63 - Sep-15-2018, 08:42 PM
RE: if else statements - by gruntfutuk - Sep-16-2018, 01:17 PM
RE: if else statements - by LinkAiris - Apr-24-2024, 10:22 PM
RE: if else statements - by DeaD_EyE - Apr-25-2024, 07:27 AM

Forum Jump:

User Panel Messages

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