#π Help with Method in Class
29 messages Β· Page 1 of 1 (latest)
@frail blaze
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.
idk how to post the code im on mobile
@misty dawn :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | 'a'+2
004 | ~~~^~
005 | TypeError: can only concatenate str (not "int") to str
same thing here but instead of a number
you are trying to add your own class to the string
with self
ohhh yeah
you could also add a __str__ or __repr__ so that you can set a custom thingy for calling it as a string if you want
yeah i was able to do it before but i forgot
i always forget like 1 thing
lol
thanks
np
is this good for 3 days into learning ππΌπ
i feel like im slow when it comes to this lmoshh
learning classes 3 days into python is really good!
personally I didn't learn class stuff until a few weeks into python
yeah my younger brother knows lua and he told me to learn this
like i just ask him what to learn and he tells me like learn oop
and he said tables too
What about 1 day π
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.