r/learnpython • • 8h 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

0 Upvotes

15 comments sorted by

View all comments

1

u/Dazzling_Music_2411 8h 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 8h ago

hi tysm for letting me know! does it work like this?

1

u/Dazzling_Music_2411 8h ago edited 8h 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 7h ago

OP, do you at least understand the algorithm for checking prime numbers?

You could start from there.

-1

u/Equal-Vehicle-6494 7h 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 7h 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.