AllenDowney / ThinkPython2

LaTeX source and supporting code for Think Python, 2nd edition, by Allen Downey.
Other
2.5k stars 1.65k forks source link

do_four.py IS WRONG #106

Closed Srjuanfra closed 1 year ago

Srjuanfra commented 1 year ago

in that document is supposed that in function "do_twice" you call the function "print_twice" not just "print"

Watynecc commented 1 year ago

Dude just the exercice is a bad practice why not using loops ???

espinoza commented 1 year ago

Dude just the exercice is a bad practice why not using loops ???

Of course. But this exercise is introduced before loops.

EDIT: Remember this is a book to learning to think like a programmer, and this way without using loops is part of the process.

AllenDowney commented 1 year ago

Right, the intent is to practice using the features we have so far -- and especially to practice writing functions and calling them.

But it's not a great exercise. I'm cutting it from the third edition.