Hello, I'm an introvert to Python.
Recently, I've been coding through various questions and studying Python concepts, and I'm leaving a question like this because I have a question. I'm sorry it's a bit of a gruelling question, but I'm very curious from the point of view of the introduction.
For example, if you apply the dir function for a str type, the following list appears:
I wonder what exactly the lists mean here. (I understand the related method through Googleing, but I only feel it, so I'd like to hear a more detailed explanation.)
Also, I wonder exactly what is the difference between '__
being pasted back and forth' and 'not'.
If you enter the type function, it says class : str, but str or int is also called class. From the beginner's point of view, it's just an integer, a string, but I don't understand what class means, so I'm asking you a question.
python directory class
A1: It's not just a "method," but it's a return of all the attributes of the object/class. Generally speaking, a method is a type of attribute that a class has. For double underscore (__
)... I'll finish the turn by posting an answer posted by another expert.
A2: "hello"
is not just a string, but rather a template that has the function of expressing a string (and has few other functions) with the value "hello".
Can you think of it like this? Let's say I was driving and saw something on the side of the road that said "Children's Reservation." What we see is the word child sanctuary itself? Technically, we've seen the strong sign with that writing. Some signs can be set with variables such as is_glowing_in_night = True
from the beginning, and some can be set up and then act like .watchDrivers()>, but that child protection sign just exposes the message 'this is a child protection zone' to anyone. In this way, a "str class" is a class that doesn't have any special features or features, but just exposes a particular string to anyone.
There may be inaccuracies in the contents so far. Please refer to it.
© 2024 OneMinuteCode. All rights reserved.