
Questions addressed in this post:
- How can I define functions in Python and what are parameters?
- What is Advanced Parameter Handling For Functions?
- How can I use args(*) and kwargs(**) in Python?
What you will learn:
- Define a function that takes parameters.
- Args(* Arguments) and kwargs(** Keyword Arguments) and how to use them.
- Set default values for function parameters.
- Explain how we can use args(*) and kwargs(*) for Advanced Parameter Handling For Functions and Decorators
Ok so let’s dive in the code. Also read the code comments for better understanding:
Electronics Engineer by book, Software Architect and Technopreneur by passion, Open Source Enthusiast, Problem Hacker, Enabler, Do-Tank, Blogger, Autodidact, Yogi and an avid Reader. Involved in Building Products. Having loads of experience and technical expertise in areas ranging from Full Stack Web Application Development to Big Data Analysis, Modeling, Processing and Visualization, he is currently involved in working on Python, Django, Javascript, SQL, Bootstrap, PostgreSQL, RRD (Round Robin Database), MySQL, MonetDB, LevelDB, BerkeleyDB, Redis, Apache Spark, Pandas, SciPy, NumPy etc.
Ali Raza received his Masters Degree in Electronics Engineering which involved Research focused on Machine Learning. He is currently working as a Chief Technical Officer at BitWits (Pvt) Limited, CEO & Founder at DataLysis.io and CEO & Founder at LearningByDoing.io.