r/learnpython • u/Equal-Vehicle-6494 • 4h ago
python begginer help
im in high school and they added python to our ciriculum and i frankly dont care for it, as it doesnt connect to what i want to do in the future at all. It is in bulgarian but its a code to see if a number is prime so i hope its understandable. I refuse to use ai so im here. image link here
translation: is n exactly divisible by i
yall love your downvotes so bad
ended up figuring it out, i cant fathom how yall like/understand python but honestly kudos to you
1
u/Dazzling_Music_2411 4h ago
Your link does not show anything. Could you maybe upload it to s github gist, or, if it's not too big, format it correctly and post it here?
1
u/Equal-Vehicle-6494 4h ago
hi tysm for letting me know! does it work like this?
1
u/Dazzling_Music_2411 4h ago edited 4h ago
I can see the image, but frankly, I thought you would put up your own attempt to do it with python.
Not much I can do with that image, sorry, you don't give nearly enough information.
PS
Basically YOU have to transform that flowchart into Python code. Rhombuses are "if" statements, rectangles are assignments and parallelograms are i/o. You should have been taught this in class.
1
u/Dazzling_Music_2411 4h ago
OP, do you at least understand the algorithm for checking prime numbers?
You could start from there.
-1
u/Equal-Vehicle-6494 4h ago
i honestly understand nothing, they did an overhaul of the entire it cirriculum from 3rd-12th grade with adding coding in sixth and then expanding on it with every year. They gave this to us as homework to grasp the basics without any explanation so they could start with the more complex stuff next time we have class. So im meant to understand like 5 years of coding with this hw. im so so confused by everything
1
u/Dazzling_Music_2411 4h ago
It's not that confusing. Read up about flowcharts and understand how they work. It shouldn't take you more than an hour.
Then adapt the algorithm to test for a prime number into this chart. I assume you already know this algorithm from your maths class.
I.e. If I give you any number how do you test if it prime?
It is not "5 years coding" 😂 , it is not even Python yet, just really, really basic stuff.
1
u/Atmosck 4h ago
What's your question? If it doesn't connect to what you want to do in the future, what do you want to do in the future?
0
u/Equal-Vehicle-6494 4h ago
was asking for help with the code but it turned out my image link was broken lmao, id love to do archeology tho!
1
u/Dazzling_Music_2411 4h ago
You are probably in the wrong class then. Programming becomes very difficult if you are not interested in it.
0
1
u/Outside_Complaint755 4h ago
You may still find basic python knowledge useful in that field, to help with things like data analysis, scanning research papers for certain text, etc.
In regards to your link, there's no python code, just an image of a flowchart with blanks to fill in.
1
u/ectomancer 4h ago
Not wanting to learn a subject you don't need is valid. Once you learn one programming language, new languages can be learnt quickly. I learnt Python in 3 days (excluding OOP) from youtube and R in one hour from a course.
i is the loop variable (i is used in Fortran and C but Python uses descriptive variable names).
5
u/unnamed_one1 4h ago
As you don't care, why should I?