Afiz โšก๏ธ
Afiz โšก๏ธ

@itsafiz

7 Tweets Feb 03, 2023
Built-in Functions in Python (with code snippets)
Python has a great set of built-in functions, which are very powerful.
In this thread, we will discuss 4 of them. Follow me @itsafiz if you don't want to miss the reaming functions in the future.
A Thread ๐Ÿงต๐Ÿ‘‡
1. round() function in Python
the round function is used to convert the floating-point into a specified number of decimals number
2. set() function in Python
the set function is used to create the set object. set can also be used to remove the duplicates from the list or tuple ๐Ÿ™‚
3. slice function in Python
The slice() function returns a slice object that is used to slice any sequence (string, tuple, list, etc..)
syntax: slice(start, stop, step)
4. sorted function in Python
The sorted() function is used to sort the iterables like lists, tuples and strings.
syntax: sorted(iterable, Key=None, reverse=False)
Out of these 4 functions, slice is my favourite.
Which one is your favourite? Please let me know in the comments.
Find the source code: github.com
โญ๏ธ Star the repo if you like the content.
That's all for this thread!
Follow me @itsafiz, if you don't want to miss such content.
Like and RT the first tweet in the thread and support me to create more content like this.
Cheers ๐ŸŽ‰

Loading suggestions...