In the code below is a Python function that take a list of numbers as an input and then filters out the prime numbers in the list.
Similarly, the keyworded **kwargs arguments allows the user to pass a variable number of keyworded arguments to a function.
For instance, you can pass a dictionary of arguments to a function and unpack them using **kwargs.
Check the example below:
1
51
Yes, *args and **kwargs allow for passing an unlimited number of arguments to a function in Python.
The special syntax *args in function definitions in Python allows us pass a variable number of non-keyworded arguments to a function. Find an example below.
1
34
Do you know there is dictionary comprehension in Python, which works just like list comprehension?
It helps create a dictionary with one line of code.
Take a look at these two code snippets. One uses traditional for loop and the other uses comprehension. Which one is easier?
2
96
List comprehension is a game-changer in Python! With just one line of code, you can create, filter, and transform lists.
Check these two examples; the first one the traditional way, the second one using list comprehension.
3
245
My first web dev project with HTML, CSS, and @getbootstrap CSS, thanks to @yu_angela course
Based on @mathsppblog's advice, I have been playing around the Rich Python library. I must say it is truly rich! Below is a snippet:
With the #colorama package you can actually print output in Python in your desired color as below

















