Callbacks https://play.golang.org/p/oPTSePAAHNj

https://play.golang.org/p/oPTSePAAHNj

When I run this program, I don’t know where 45 comes from. Because the sum of the numbers is 44

No: 1+ 2+ 3+ 4+ 5+ 6+ 7+ 8+ 9 at DuckDuckGo

Oh gosh ! LOL You’re right! How did I screw that up??? I guess I better go back to 3rd grade!

When you encounter a problem like this, it often helps a lot to do the math on a calculator, and re-read your code to see exactly what is happening.

Computers are just calculators and tools, and they do not make math mistakes. If a result isn’t what you expect, you either have a code problem or a user problem :stuck_out_tongue:

3 Likes

Lol. Hey thanks. Good advice

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.