r/learnpython • • Aug 27 '24

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

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.

0 Upvotes

13 comments sorted by

11

u/throwaway6560192 Aug 27 '24

You're supposed to show the user two spellings of a word, let them guess which one is correct, and give them feedback on whether they answered right or wrong.

2

u/Puzzleheaded-Pay641 Aug 27 '24

Thank you 🥰 this is gonna go great with my inability to read today 😂

4

u/jmeppley Aug 27 '24

Oof. As a parent of ND children, I feel you.

Sideways suggestions:

* Reach out to your school's counselors to see if there is any way the school can support you.

* Ask for help on r/ADHD? They may be better at breaking things down for you.

As for this assignment:

  1. Algorithm: Make an outline describing the program logic. This should be detailed, but in human language, not in Python

  2. Testing: A sentence or two describing how to test it

  3. Coding: Modify Spellings_Flashcards_24D.py to make it do what you described in (1)

3

u/Puzzleheaded-Pay641 Aug 27 '24

I will look into the school counselor thing as well because I should have access to it, I just haven’t looked

2

u/Puzzleheaded-Pay641 Aug 27 '24

Thank you very much 🥰

2

u/MovingObjective Aug 27 '24

Flashcards_First_Complete_Version.py,

Sorry, not a fan of a wall of text here either, but you can tell your teacher that this is not how you name python files.

https://www.python.org/dev/peps/pep-0008/#package-and-module-names

2

u/Puzzleheaded-Pay641 Aug 27 '24

I will show them this link and make them aware, there is so much wrong with this module and how they name things and the links they send us too as well

2

u/jameyiguess Aug 28 '24

Code in most of academia is largely a gd mess, my guess is because professors don't typically go through code reviews on teams every day to get better. That's not gonna make it any easier for you. 

I wish you luck! 

0

u/[deleted] Aug 27 '24

[deleted]

2

u/Puzzleheaded-Pay641 Aug 28 '24

Did you get this from ChatGPT because I just put my question into it and got the same response.....

1

u/QultrosSanhattan Aug 28 '24

I'll allow you to guess first.

2

u/Clearhead09 Aug 27 '24

While the rest of this comment is good. The very first sentence is insanely important to those of us with ADHD.

It’s so easy to over think these things and make it more difficult than it should be.

First I’d make a sample dictionary and write a function that looks up a word and shows the real definition.

Then alter the function to give the 2 seperate meanings to choose from etc etc.

I find trying to do the whole exercise at once nearly impossible but once you have the basics down the rest is relatively easy with trial and error.

Happy to chat if you want to connect with someone else with ADHD learning python.

1

u/Puzzleheaded-Pay641 Aug 28 '24

I will drop you a message because I would love to connect and chat about this, I'm 100% overthinking it, I think I've got the code down, just the format of this question is so bad