<p><br>
On 12 Feb 2012 00:29, "amt" <<a href="mailto:0101amt@gmail.com">0101amt@gmail.com</a>> wrote:<br>
><br>
> Hello! I'm currently stuck at the Extra Credit 3 from LPTHW.<br>
><br>
> Link to the actual exercise:<a href="http://learnpythonthehardway.org/book/ex19.html">http://learnpythonthehardway.org/book/ex19.html</a><br>
> The exercise:<br>
> Write at least one more function of your own design, and run it 10<br>
> different ways.<br>
><br>
><br>
> Code from the book:<br>
> def cheese_and_crackers(cheese_count, boxes_of_crackers):<br>
> print "You have %d cheeses!" % cheese_count<br>
> print "You have %d boxes of crackers!" % boxes_of_crackers<br>
> print "Man that's enough for a party!"<br>
> print "Get a blanket.\n"<br>
><br>
><br>
> print "We can just give the function numbers directly:"<br>
> cheese_and_crackers(20, 30)</p>
<p>> I wrote a function similar to cheese_and_crackers and it works just<br>
> fine but I can't figure out more ways of calling a function other than<br>
> the ones presented in the code(with integers as arguments,variables as<br>
> arguments, two integer additions as arguments and with arguments in<br>
> the form of variable+integer). The author states that there are 10<br>
> different ways to run it.(in a comment he states that: "You can run it<br>
> a lot of different ways, far too many to enumerate.).<br>
><br>
><br>
> So, what other ways are there aside the ones already presented in the<br>
> above code?<br>
><br>
></p>
<p>Hi,</p>
<p>Subject to the same caveats as your other replies:</p>
<p>How about</p>
<p>for (cheesecount, crackercount) in [(3,5), (7,42)]:<br>
cheese_and_crackers(cheesecount, crackercount)</p>
<p>Best,</p>
<p>Brian vdB</p>