A guy at the Boise library showed me one line of code that fixed my whole calculator project
I was stuck on a simple calculator in Python for 3 days and getting so mad at my screen. Last Saturday I went to the beginner coding meetup at the Boise library branch on Cole Road just to watch people, and this retired guy named Hank sat next to me. He looked at my code for like 10 seconds and said "your input is a string, buddy, turn it into a number first." I added int() around my input and it worked on the first try, 3 days of pain gone in 30 seconds. Has anyone else had a bug that turned out to be one tiny thing like that?
Honestly the "your input is a string" thing gets almost everyone at some point. Input in Python hands you back text, so "5" plus "3" gives you "53" and "5" times 3 just repeats it. The other one that bit me was float vs int, cause if someone types 2.5 into an int() you get a crash instead of a number. Try float() if you want decimals, and wrap it in a try/except so bad input doesn't blow up your whole program.