defadd(num1, num2):
total = num1 + num2
print(total)
add(1,2)
List as arguments
Instead
of
giving
multiple
arguments,
we
can
pass
a
list
as
a
single
argument
that
holds
multiple
values
.
The
list
is
then
accessed
inside
the
function
via
indexing
.
deffunction_name(list_argument):
<function body>
my_list = [1,2]
defadd(list_num):
total = 0for i in list_num:
total = total + i
print(total)
add(my_list)
#my_list will be passed to list_num, and it will be used inside the function
*args
By
passing
*args
as
an
argument
to
a
function,
Python
allows
us
to
pass
any
number
of
arguments
to
a
function,
and
it
will
store
them
in
args
like
a
List
.
deffunction_name(*args):
<function body>
defadd(*args):
total=0for i in args:
total = total + i
print(total)
add(1,2,3,4)
Sign In
You will receive an OTP for verification purposes.
Our Result
Sanatan is our in-house coding prodigy who ranked as a Top 2 finalist in Google’s Code-In competition (now defunct). He’s a great example of how starting early in your coding journey can be so empowering that you can even find yourself tackling challenges at tech giants like Google!
What the world says about Tekie
“While most competing platforms are teaching students block-based programming, Tekie is attempting to teach young students the fundamentals of text-based programming, which is to write actual coding language syntax.”
The founder elaborates, “We came up with the idea of animation because that helps bring imagination to reality. We also wanted to make learning interesting and engaging.”
Parents trust us.
The best learning happens when you are not learning, you are playing and enjoying. For Medha, learning has been a pleasant glide, thanks to a warm and interpersonal method of teaching; it's like she is learning from a friend who knows her! She loves the puzzles and other methods used- both experimental and classic.