CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickAcademy Python · 7 min · free

Function Arguments: Positional, Default and Keyword Parameters

7 min4 KwickClipsFull text belowFree
Next lesson →Kajal Ma'am (MCA), teaching since 2004Remembered in this browser

Learn Python function arguments for CBSE Class 12: parameters vs arguments, positional, default, keyword, order rules, errors. A parameter is the name in the def line; an argument is the actual value sent in the call.

Follows the syllabus of: CBSE Class 12 Computer Science (083)

On screen in this lesson

Parameters vs arguments

TermWhere it isExample
ParameterIn the def linename, amount
ArgumentIn the call"Riya", 199
Also calledformal / actualsame idea

The three kinds together

KindWritten whereExample
PositionalIn the callticket("Aman", 15)
DefaultIn the def lineqty=1
KeywordIn the callage=15

Order rules

In a call: positional first, then keyword
In def: parameters without defaults come first
Each parameter gets only one value
Every parameter without a default must get a value
Do not send more arguments than parameters

Common errors: fee(amt, gst)

MistakeErrorWhy
fee(9)TypeErrorgst is missing
fee(9, 1, 2)TypeErrortoo many values
fee(9, amt=1)TypeErroramt got two
fee(amt=9, 1)SyntaxErrorkeyword first
def g(a=1, b):SyntaxErrordefault first

Quick recap

Parameters are in def; arguments are in the call
Positional: matched by order
Default: used when no value is given
Keyword: name=value, any order
Positional before keyword; no list defaults

Quick answers

What does "missing 1 required positional argument" mean?

A parameter without a default got no value in the call.

Can a keyword argument come before a positional one in a call?

No. That gives a SyntaxError. Positional comes first.

KwickClips from this lesson

Short clips, one idea each. Good for revision the night before.

The full lesson, in text

Hello students, welcome to Kwickprep. Have you seen Python say, missing one required positional argument? What does that mean, and how do you fix it? Today we will learn positional, default and keyword arguments, the order rules, and one famous trap.

First, a quick reminder. A function is a named block of code, made with the keyword def. Writing its name with round brackets is a call, and a call runs it. This recharge function takes a name and an amount. The call gives Riya and one hundred ninety nine, so it prints Riya paid one hundred ninety nine.

Two words sound alike, but they are different. A parameter is the variable name written in the def line, like name and amount. An argument is the actual value sent in the call, like Riya and one hundred ninety nine. Some books call parameters formal parameters and arguments actual parameters. Think of a parameter as an empty box, and the argument as what you put inside.

Positional arguments are matched by their position, which means their order. The first argument goes to the first parameter, and the second goes to the second. In the first call, name gets Aman and age gets fifteen. In the second call, we swapped the order. Python does not complain, but it prints fifteen is Aman, which is wrong. So with positional arguments, order matters.

A default argument is a value written in the def line, which is used when the call gives nothing. At a canteen, most people order just one item. So the parameter qty, short for quantity, has a default of one. The first call gives only samosa, so qty uses one. The second call gives three, so three replaces the default.

A keyword argument names the parameter in the call. We write the parameter name, an equals sign, and the value. Here this equals sign does not compare anything. It simply says which parameter gets which value. Now the order does not matter. Age is written first, yet the output is correct, Aman is fifteen.

Let us put the three kinds side by side. Positional arguments are matched by order, in the call. Default values are written in the def line, and they fill in when a value is missing. Keyword arguments use the parameter name in the call, so order does not matter.

Python has strict order rules. In a call, positional arguments must come before keyword arguments. In a def line, parameters without a default must come before parameters with a default. Each parameter can receive only one value. Every parameter without a default must receive a value. And you cannot send more arguments than there are parameters.

Here, the function fee has two parameters, amt for the amount and gst for the tax, and each row breaks one rule. Calling fee with only one value gives a type error. Python says, missing one required positional argument, because gst got no value. Sending three values also gives a type error, because there are only two parameters. Sending nine by position and then amt equals one gives amt two values, so again a type error. Putting a keyword argument before a positional one gives a syntax error. In the last def line, a default parameter comes before a plain one, which is also a syntax error.

Now all three kinds work together in a shop bill. The parameter off is the discount in rupees. Bill of fifty uses both defaults, so it returns fifty. Bill of fifty and four gives four items, so two hundred. The third call skips qty and uses a keyword for off, so fifty minus ten is forty. Pause and predict. What does bill of fifty, with qty equal to zero, print?

Here is that call, so you can check your answer. Qty is zero, so price times qty is zero. The discount is also zero by default. So it prints zero, not fifty.

Board exams often ask output questions such as this. Remember, multiply happens before add. In the first call, runs is one and both defaults are used, so one plus two times three is seven. In the second call, times becomes ten, so one plus twenty is twenty one. In the third call, both are keywords, so five plus zero times three is five.

This part is for advanced courses. A list is mutable, which means it can be changed after it is made. Append adds an item to the end of a list. We expect each call to start with an empty bag. But the second call prints pen and book together. Why? The default list is made only once, when the def line runs, and every call shares it.

The safe way is to use None as the default. None is a special value that means nothing. The is operator checks whether bag is exactly None. If it is, we make a fresh empty list inside the function. Now every call gets its own new bag, so pen and book stay apart.

Let us revise what we learned today. Parameters are written in the def line, and arguments are the values in the call. Positional arguments are matched by order. Default values are used when the call gives no value. Keyword arguments use the parameter name, so any order works. Keep positional before keyword, and never use a list as a default value.

Courses that teach this

CourseUnit
CBSE Class 12 Computer Science (083)Computational Thinking and Programming – 2
Programming All levels PythonFunctions

Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.

Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →