[Tutor] return, why do I need it?
bodsda at googlemail.com
bodsda at googlemail.com
Sun Dec 11 15:56:10 CET 2011
Why unindent functions for testing?
Challenge: write a function called myadd(one, two) that accepts 2 parameters, both will be ints. When the function is called, it should add both parameters together.
It should allow me to do this:
a = myadd(5, 10)
a += myadd(10, 5)
a == 30
True
Hopefully that shows one usage of return values
Hth,
Bodsda
Sent from my BlackBerry® wireless device
-----Original Message-----
From: "Pete O'Connell" <pedrooconnell at gmail.com>
Sender: tutor-bounces+bodsda=googlemail.com at python.org
Date: Mon, 12 Dec 2011 01:08:47
To: <Tutor at python.org>
Subject: [Tutor] return, why do I need it?
_______________________________________________
Tutor maillist - Tutor at python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list