#๐Ÿ”’ why both have diff init but works the same

11 messages ยท Page 1 of 1 (latest)

cobalt turtle
daring haloBOT
#

@cobalt turtle

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.

celest berry
# cobalt turtle

Because they both set ._name and access it. They're the same code, you've only changed the name of property you're using.

cobalt turtle
#

i learned yesterday that when the init is called it sends the valuue to the setter method..is that correct?

#

i think gpt says that..if i call the private attribute in the init then the setter doesn't get called and if i wrote a public name in the init , setter gets called.
@celest berry

celest berry
cobalt turtle
#

oh

#

okk

#

!close

daring haloBOT
#
Python help channel closed with !close

This help channel has been closed. 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.