Please help me, in simple terms, understand the "def" function.
CodeGreen :: Programming :: Python :: Help!
Page 1 of 1 • Share •
Please help me, in simple terms, understand the "def" function.
I know how to use functions and how to create the calculator program by my self, but I don't understand the function of "def".
Last edited by johnny-johnson on Sun Apr 19, 2009 11:02 am; edited 1 time in total
johnny-johnson- New Guy

- Posts: 1
Reputation: 0
Join date: 2009-04-19
Re: Please help me, in simple terms, understand the "def" function.
The def function is something that creates a function,
which is something that repeats an action over and over again.
A function can have parameters:
which is something that repeats an action over and over again.
A function can have parameters:
- Code:
def print2(var):
print var
def add(x, y):
print x + y
hello = 'Hello!'
add(1, 2) #3
print2(hello) #Hello!

Xarver- Admin

- Posts: 32
Reputation: -1
Join date: 2009-04-17
Location: Somewhere

Permissions of this forum:
You cannot reply to topics in this forum



