replit
Build and deploy software collaboratively with the power of AI without spending a second on setup.
42 messages ยท Page 1 of 1 (latest)
Build and deploy software collaboratively with the power of AI without spending a second on setup.
@flat widget
Remember to:
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
@open fern hi, i just worked on the assignment and i got to a confirmation to writing the details to an order file, and it works
i have a problem where it asks for the confirmation after only 1 patio instead looping it in the for loop
nvm, just fixed it
my writing function was inside of the for loop instead of out
i just have a problem where it needs to confirm without any actions after every patio
just fixed it lol
ummm
somethings weird, when i try to input a customer code of 1 and take 2 orders for it this happens
this is my input
Customer code = 2
Type of slab = York
TotalArea = 12
Totalcost = 753.0
Customer code = 1
Type of slab = Dover
TotalArea = 12
Totalcost = 360.0
this is what it saves to the file
it put the first one as customer code 2 for some reason and as york
yup
so, first of all, I would rather you make "saving data to a file" in a separate function
So it doesn't look too... messy or complex
alright
secondly, you need to find a way to hold all of the input and calculated data in your orderinfo of a customer before writing it to a file
this can be in a dict or list or class or something
so i make a dict and just append it to it?
oh okay
ok
IIRC, you said you don't know much about classes
And I wish I have time but atm I'm leaving it to youtube to explain it
๐๐๐๐ฃ ๐ช๐ฅ ๐๐ค๐ง ๐๐ค๐๐ง๐๐ฉ๐๐๐ ๐พ๐ค๐ช๐ง๐จ๐๐จ: https://www.socratica.com/collections
๐๐ค๐๐ง๐๐ฉ๐๐๐ ๐๐ฎ๐ฉ๐๐ค๐ฃ ๐จ๐๐๐ง๐ฉ: https://shop.socratica.com/products/python-by-socratica
In this tutorial on object-oriented programming (OOP) in Python, we use the analogy of making cookies to explain the concepts of classes and objects. This allows you to understand the distinction ...
So what you can do is make a class called Customer and have it hold the orders attribute. And the orders attribute would be a list of the type of slab, the calculated patio area, the total cost.
That would be neat.
I'll check back in a while
i need to go out right now so ill work on it when im back, thanks
so just to make sure i need to make a function of writing to a file, then make a class holding the customer details?
yes
okay thanks
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.