Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

How can I define a program of Python with optional arguments?

Asked by Delbert Rauch Nov 23, 2023 691 views 1 answer
Share

About this question

I was designing a function by using Python in which I needed to include the total cost of a shopping cart. There were various arguments and among them, there was an Optional argument of the discount percentage that users can apply. How can I implement this particular optional argument in my function and what will the process of utilising it by the users when calling the function? 

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.