adada.py (@pythoncodestar) header
adada.py (@pythoncodestar) profile picture

I tweet about my learning experience in coding and programming. I share useful resources to help python coding newbies improve their coding skills.

Joined January 2022
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.
1
1
88
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
When we call the add function, it will now log its inputs and outputs:
1
2
54
Python is rich in built-in methods for string manipulation. Here are a few examples
1
1
6
864
My first web dev project with HTML, CSS, and @getbootstrap CSS, thanks to @yu_angela course
1
1
1
91
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:
1
2
13
2,825
With the #colorama package you can actually print output in Python in your desired color as below
5
3
19
3,778
First one walks you through the solution; second one makes life easy for you:)
1
3
1
6
379