asterik in python code example
Example 1: what happen when we apply * before list in python
Asterisks for unpacking into function call
That print(*fruits) line is passing all of the
items in the fruits list into the print
function call as separate arguments, without
us even needing to know how many arguments are in the list.
... Both * and ** can be used multiple times in function calls
Example 2: * meaning in python
The * in python represents "The rest".
Meaning it will take the remaining arguments that are left over in your
code and fit inside the variable OR you can use it as your primary
variable to store as many arguments that you want.
After doing this it it will convert them into a list.
Example 3: how to use asterisk in python
quotient = 3 * 4
print(quotient) #Answer=12