#๐ I dont understand how this works at all.
96 messages ยท Page 1 of 1 (latest)
@warm fable
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
!code
oh i need to put the code in a pastebin thingy?
Or
If it's too long to paste here
!code
We don't allow file uploads.
You have to share the resulting URL
And what's your question?
There's an error on line 218 I think
I dont get anything. I cannot even comprehend anything
it just doesnt make sense to me
i dont understand how the code works
Did you write it?
no
it is the code i have to refer to for my final year exam
like for example i dont get what a 2d list does
and then when i get an explanation
i dont understand like what the 2d list in the code actually does
Break it down and look at each function one at a time. Understand each function, then look at how they interact with each other.
Have you modified the code at all?
no
i was given a python 2 version of the code and a python 3 version of the code
thats genuinely my issue. Im so stupid i dont get how they interact
i dont understand some of the stuff in the program as well
So you're not stupid, you just don't know Python
basically
You should stop calling yourself stupid.
no im stupid for not revising the entire year
Do you have a book to learn from?
yeah i guess so but sometimes when i read a book it suddenly turns into words
it no longer goes into my head
By "interact", I mean look at what data is going in an out of the functions. These functions take data in the form of parameters, and give data back in the form of return values. To see how the program operates, look at where data is originating, and then see what functions the data is passed into.
If you're behind in your studies though, you may need to take a step back and reinforce the fundamental concepts used here, like functions and classes.,
There's no replacement for experience.
oh so like some tracetable stuff
Trace table? Do you mean traceback?
wait lemme give u an example
A trace table is a technique used to test algorithms in order to make sure that no logical errors occur while the calculations are being processed. The table usually takes the form of a multi-column, multi-row table; With each column showing a variable, and each row showing each number input into the algorithm and the subsequent values of the va...
Oh, I didn't know that had a name. Im surprised I've never come across that before.
And that can help, yes. I often create one of those on paper while debugging.
Yeah it's just pen-and-paper debugging
What I meant is looking at how data "flows" through the program. That's how I tend to make sense of code. Programs typically have somewhere where data is "created" (read from a file or the internet), functions that do something to the data (they take the data, modify it, and return new data), then somewhere where the data is output (written back to file or send back over the internet).
If you think about it like that, you can visualize programs and "pipes" of data from where the data comes into the program, to where it's output at the end.
I'm a very visual person, so seeing programs as pipes/wires of data has always helped me.
ah alright
well i think one of the issues may be the fact that i dont understand certain programming constants so to me it looks like the data is going through one pipe and teleporting out of another
If you're behind in your knowledge though, start there. You can't read code that uses concepts that you don't understand.
like one of the parts of the codes it makes like 51 lists
why it makes 51 lists?
i have no clue
yeah
ahhh
oh so i trace where the data goes and the problem i stumble upon i revise that
Once you have a good grasp of the fundamentals involved, yes, that would be a good way of approaching it. Or at least the way that I tend to approach reading code.
You'll find what works for you over time.
ah ok
its because i find big blobs of code confusing
also whats the best place
to learn those fundamentals from
like any specific sites or channels or?
!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
thank you
If you don't want to read your book there are some video resources there
Not GeeksForGeeks. Unfortunately, I can't recommend specific sites because I learned Python like a decade ago from books.
not geeksforgeeks?
No, they're trash and spread misinformation.
oh damn ๐
RealPython is the best Python site I know of, but I've only skimmed their stuff when helping other people who are referencing their site.
ah alright
They seem pretty good though.
thank you guys for the help
ill make another post if i find anything specifically difficult
is there anything else i should know
Ya, specific questions are far easier to answer. "Help me understand 200+ lines of code" is difficult to answer well.
sorry, my bad ๐
No, it's fine. It's quite common. That's just more of a suggestion. You'll get better help with better-defined questions.
You're welcome. You can !close this thread if you're done (it will auto close itself if you don't after an hour).
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.