#python_builtins_by_driscollis zoekresultaten
#Python includes a handy built-in function called `input()` that you can use to prompt the user for information. The function will read what the user types in and return it as a string #python_builtins_by_driscollis 🧵🐍👇
Did you know there is a handy built-in for #Python called `hasattr()`? It takes in the object and a string. The result is True if the string is the name of one of the object’s attributes, False if not. #python_builtins_by_driscollis 🧵🐍👇
#Python has the useful `globals()` built-in It returns the dictionary implementing the current module namespace. For code within functions, this is set when the function is defined and remains the same regardless of where the function is called. #python_builtins_by_driscollis
Another great #Python built-in function is `getattr()`. `getattr()` will eturn the value of the named attribute of object. If the string is the name of one of the object’s attributes, the result is the value of that attribute. #python_builtins_by_driscollis 🧵👇🐍
#Python includes two functions for creating sets. You are probably familiar with `set()`, so let's talk about the `frozenset()` built-in today! ☃️🐍 docs.python.org/3/library/stdt… #python_builtins_by_driscollis 🧵🐍👇
#Python includes a `format()` function that is built-in. This function is very similar to the string's `format()` method, but is more low-level than that method docs.python.org/3/library/func… #python_builtins_by_driscollis 🧵🐍👇
#Python includes a handy `filter()` function that is built-in `filter()` takes two arguments: 🐍 function - The function to call 🐍 iterable - An iterable of items to pass to the function #python_builtins_by_driscollis 🧵🐍👇
#Python includes an `exec()` built-in that is closely related to the `eval()` built-in. The difference is that `exec()` can take code blocks, but it always returns None #python_builtins_by_driscollis 🧵🐍👇
One of #Python's most controversial built-in functions is `eval()`. The main reason it is controversial is that it can be used to execute arbitrary code. #python_builtins_by_driscollis 🧵🐍👇
#Python includes a built-in function called `divmod()` which will take two (non-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. #python_builtins_by_driscollis 🧵🐍👇
#Python includes several handy built-in functions you can use to work with class attributes. One such built-in is called `delattr` and is used for deleting attributes. I have never really needed this built-in myself, but here's an example #python_builtins_by_driscollis
#Python includes the `complex()` built-in function, which will return a complex number with the value real + imag*1j or convert a string or number to a complex number Let's learn more about how `complex()` works! #python_builtins_by_driscollis 🧵🐍👇
Another great #Python built-in is `chr()` 🐍🔥 `chr(i)` will return the string representing a character whose Unicode code point is the integer i. Note: This is the inverse of `ord()` Below are a couple of examples: #python_builtins_by_driscollis
Another great built-in #Python function is `callable()` According to the docs, `callable()` will return True if the object argument appears callable, False if not. #python_builtins_by_driscollis 🧵🐍👇
#Python has a `bytes()` built-in that is closely related to its `bytearray()` built-in. 🐍🔥 The difference is that `bytes()` as immutable! `bytes()` has the same non-mutating methods and indexing and slicing behavior. #python_builtins_by_driscollis
Python includes a built-in callable named `bytearray()`. The bytearray class is a mutable sequence of integers in the range 0 <= x < 256. They return a new array of bytes #python_builtins_by_driscollis 🧵🐍👇
#Python includes a `memoryview() built-in class. According to the docs, "memoryview objects allow Python code to access the internal data of an object that supports the buffer protocol without copying." #python_builtins_by_driscollis 🧵🐍👇
#Python includes a `memoryview() built-in class. According to the docs, "memoryview objects allow Python code to access the internal data of an object that supports the buffer protocol without copying." #python_builtins_by_driscollis 🧵🐍👇
Starting in Python 3.7, the `breakpoint()` built-in function was added It is defined in PEP 553 and simplifies adding a breakpoint to your code #python_builtins_by_driscollis 🧵🐍👇
Starting in Python 3.7, the `breakpoint()` built-in function was added It is defined in PEP 553 and simplifies adding a breakpoint to your code #python_builtins_by_driscollis 🧵🐍👇
Today is the last day of my tour of #Python's built-in functions! Did you know there are over 75 built-in functions, classes and decorators in Python? 🐍🤯🔥 If you didn't, you might want to checkout my full series of tweets using this hashtag: #python_builtins_by_driscollis
#Python comes with lots of built-in methods. One such method is called `reversed()`, which returns a reverse iterator. You can use `reversed()` to reverse sequences which have __reversed__() implemented #python_builtins_by_driscollis 🐍🔥 Here are a few examples:
#Python includes the useful `set()` class. You can use `set()` to create an empty set or cast another data type to a set. Here are a few examples: #python_builtins_by_driscollis 🧵🐍👇
#Python includes a function called `vars()`, which will return the __dict__ attribute for a module, class, instance, or any other object with a __dict__ attribute. Without an argument, `vars()` acts like `locals()` #python_builtins_by_driscollis 🧵🐍👇
Python includes the `int()` function built-in. You can use `int()` to cast floats or strings to integers #python_builtins_by_driscollis Here are a few examples:
#Python includes a `float()` function as one of its built-ins. You can use `float()` to create a float from an integer or string. Strings must be decimal numbers, can include whitespace or a sign. See the following screenshot for examples: #python_builtins_by_driscollis
#Python includes several handy built-in functions you can use to work with class attributes. One such built-in is called `delattr` and is used for deleting attributes. I have never really needed this built-in myself, but here's an example #python_builtins_by_driscollis
#Python includes a function called `vars()`, which will return the __dict__ attribute for a module, class, instance, or any other object with a __dict__ attribute. Without an argument, `vars()` acts like `locals()` #python_builtins_by_driscollis 🧵🐍👇
#Python has a `pow()` function built-in. This function isn't about power though. Instead, it's about exponents! Basically, `pow()` will return the `base` to the power `exp`. Note that it is the same as base**exp #python_builtins_by_driscollis 🧵🐍👇
#Python has a `bytes()` built-in that is closely related to its `bytearray()` built-in. 🐍🔥 The difference is that `bytes()` as immutable! `bytes()` has the same non-mutating methods and the same indexing and slicing behavior. #python_builtins_by_driscollis
#Python has the useful `globals()` built-in It returns the dictionary implementing the current module namespace. For code within functions, this is set when the function is defined and remains the same regardless of where the function is called. #python_builtins_by_driscollis
Another great #Python built-in is `chr()` 🐍🔥 `chr(i)` will return the string representing a character whose Unicode code point is the integer i. Note: This is the inverse of `ord()` Below are a couple of examples: #python_builtins_by_driscollis
#Python has the useful `globals()` built-in It returns the dictionary implementing the current module namespace. For code within functions, this is set when the function is defined and remains the same regardless of where the function is called. #python_builtins_by_driscollis
#Python has the `ord()` function built-in. Given a string representing one Unicode character, `ord()` will return an integer representing the Unicode code point of that character Here are a few examples #python_builtins_by_driscollis
#Python includes several handy built-in functions you can use to work with class attributes. One such built-in is called `delattr` and is used for deleting attributes. I have never really needed this built-in myself, but here's an example #python_builtins_by_driscollis
The #Python programming language includes the `tuple()` class for easy casting of other data types to a tuple. If you don't pass anything to the `tuple()` class, you will create an empty tuple Here are a few examples: #python_builtins_by_driscollis
Another great #Python built-in is `chr()` 🐍🔥 `chr(i)` will return the string representing a character whose Unicode code point is the integer i. Note: This is the inverse of `ord()` Below are a couple of examples: #python_builtins_by_driscollis
#Python has a `bytes()` built-in that is closely related to its `bytearray()` built-in. 🐍🔥 The difference is that `bytes()` as immutable! `bytes()` has the same non-mutating methods and indexing and slicing behavior. #python_builtins_by_driscollis
Something went wrong.
Something went wrong.
United States Trends
- 1. Pro Bowl 27.7K posts
- 2. Merry Christmas 407K posts
- 3. The AsterDEX 45.8K posts
- 4. Ben Sasse 2,627 posts
- 5. Happy Festivus 4,252 posts
- 6. Steve Rogers 19.8K posts
- 7. Happy Holidays 114K posts
- 8. #AvengersDoomsday 158K posts
- 9. Larry Nassar 28.9K posts
- 10. Cam Jurgens 1,046 posts
- 11. Soccer 30K posts
- 12. Endgame 122K posts
- 13. Neymar 20K posts
- 14. Jordan Davis 1,309 posts
- 15. Chris Evans 10.5K posts
- 16. Derrick Brown 1,468 posts
- 17. Brohm 2,242 posts
- 18. Jalen Carter 1,119 posts
- 19. Byron Murphy N/A
- 20. NextNRG Inc N/A