Today we will learn how to add amount in an argument in a a function
We will just create a simple function -
def add_numbers (*sai):
Here I have created a def that we will add two numbers (like a calculator)
The function is said add_numbers
The argument contains *
That's because we don't know what we want to add yet.
In the future we will add a number to it.
This will make us use manymore arguments in the end. We can add as many amounts we want.
That's it. Go ahead and complete the code.
total = 0
for a in sai:
Now as above you can add unlimited numbers for your calculator.
you may also want these -
Python Tutorial-6 (PYCHARM)