I have a class called Order that basically just creates all of the parameters as instance objects (for now). There is a class variable called order_num which is the number of orders (increases when each object is created). I want the name of each object created to be the number of orders plus one. I have a variable next_order_num for that. I need to have the name of the object being created as the numerical value for next_order_num. How would you recommend doing that?
Here is the code:
next_order_num = Order.order_count + 1
O1 = Order(next_order_num, '10/10/22', 1000, 1000, 275, '1234 street road, 12345', 25, False)
Thanks!
order1 = Order(1, ...),order2 = Order(2, ...), etc. I would recommend storing the orders in a list instead and storing the order number in theOrderitself. Please clarify since1isn't a valid object name in your example. What do you mean by "creates all parameters as instance objects"?