#๐Ÿ”’ help with assignment?

42 messages ยท Page 1 of 1 (latest)

flat widget
brave oasisBOT
#

@flat widget

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

flat widget
#

@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

open fern
#

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

flat widget
#

alright

open fern
#

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

flat widget
#

so i make a dict and just append it to it?

open fern
#

you can't append a dict. You can append a list.

#

You can make key values in dict

flat widget
#

oh okay

open fern
#

so which one you doin?

#

list or dict?

flat widget
#

i think classes since

#

its in the mark scheme

#

i would need to check it off

open fern
#

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 ...

โ–ถ Play video
#

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

flat widget
#

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?

open fern
#

yes

flat widget
#

okay thanks

brave oasisBOT
#
Python help channel closed

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.