Gia tri tra ve tu dir() khong truyen object ['__annotations__', '__builtins__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'number']
Example 2: dir () with user defined object
class Person: def __dir__(self): return ['age', 'name', 'salary']
iterators are objects that allow us to take each of its elements, this action can be repeated. in this article, quantrimang will discuss with you how the iterator works in python and how you can build your own iterator.
in python, the enumerate () function adds a counter before each iterable and returns the result as an enumerate object. the article will elaborate on the syntax, parameters and usage of the function. invites you to read the track.
the float () function in python converts the value specified to a floating-point number. how does the float () function have a syntax, what parameters do you have, how can you find out in this article with quantrimang?
in this article, quantrimang will continue to introduce you to a built-in function in python, eval (). eval () is an interesting utility that allows you to run python code (this code is passed as parameters) right in the program.