1- HW 2.4: what is wrong with this code? Does it matter that I use 'return' instead of print in this exercise?
2- HW 2.6: What does "while True" in the code bellow mean? in other word, what value are we testing if it stays 'True' ?
I appreciate any help...
To expand on @mediomelon 's answer, any expression we test in a while loop's condition will evaluate to some boolean value,
The loop will never end until you break out with a statement like
answered 08 Mar '12, 21:34
Yes, it does matter. It should print all output, including string
I.e. it should not be necessary for caller to use also
(This is actually incorrect usage of the
HW2.4 sure...although, I checked it and it did "print" (show on the screen) when I ran my code. Let's not whine about it. I got blasted off !!!
answered 08 Mar '12, 21:46