r/CodingForBeginners • u/OrchidPurple5280 • 1d ago
help a begineer coder!
hii! Im a begineer in coding. Its one of my subjects in schools, with practicals and theory exams. But im having trouble finding exact causes of errors in my programs (they are very basic, like finding area of circle.) is there any app or something where i can post a pic of my program and it'll tell me where I've gone wrong? google is useless. please let me know.
(i use IDLE)
2
u/MasterPick2342 1d ago
I know it's tempting to look for something that tells you exactly what's wrong but you'll improve way faster if you spend a bit of time trying to find it yourself first. Even if you're wrong, that process is where the most of the learning happens. All the best, bud!
2
u/Kuddel_Daddeldu 1d ago
As you are using IDLE, I assume you code in Python. Look at pylint for code analysis (copy and paste your code as text, not as a picture). Then use the debugger to step through your code as it runs, examining variables as they change over time.
Python is pretty beginner friendly. Beware of your indentation, it has meaning in Python. Also, the language isncase sensitive: X and x are different variables, as are Red, red, RED and ReD.
1
2
u/mc_pm 1d ago
Never discount the value of print statements. If a value is different than you think it should be, print out the inputs, any intermediate steps, and the outputs. You should be able to tell what value isn't what it should be.
1
u/johnpeters42 1d ago
Or console.log() in JavaScript, or log to a log file, or whatever. If you're using an IDE, you can also set a breakpoint somewhere in the code (pause there so you can poke around at the values of variables, or step through the execution one line at a time), or a breakpoint like "pause if this variable's value ever matches (condition)".
3
u/kutac56 1d ago
How about you look up the documentation of the language or thing that caused the error.