![]() |
|
[Python] Tried making a calculator and I can't figure out what I did wrong.. - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Tried making a calculator and I can't figure out what I did wrong.. (/showthread.php?tid=5629778) |
Tried making a calculator and I can't figure out what I did wrong.. - Jake - May 23, 2017 I was loooking over some Beginner python stuff A LOT recently cause i'm interested and it seems like a lot of people's first project is something simple like a calculator. Except i'm struggling and IDK what I even did.. I've looked over other calculators online and it looks like i've done nothing wrong? It always skips to the else and doesn't even consider the elif's I don't think. or I did the functions wrong or something. Pls help. Code: Code print ("Welcome to Disinterested's first calculator.")Output: Code Welcome to Disinterested's first calculator.* - szuszi2 - May 23, 2017 you are casting the decisions to an int and your checking for a char :D just change the ifs right hand sides to 1,2,3,4 instead of '1','2'.... etc :) * - Jake - May 23, 2017 (May 23, 2017 08:00 AM)szuszi2 Wrote: you are casting the decisions to an int and your checking for a char :D just change the ifs right hand sides to 1,2,3,4 instead of '1','2'.... etc :)YOU'RE MY SAVIOR! Thank you so much. * - szuszi2 - May 23, 2017 you are welcome my friend :D have fun coding |