Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Learning Aids/Tools 2 years ago
Posted on 16 Aug 2022, this text provides information on Learning Aids/Tools related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I'm building a small, simple program to aid myself in studying languages and other things.
The concept is simple, I will enter a list of words, definitions, and translations etc. The script will print these items from the list one at a time, and then wait for my input of y (yes I want to delete this word from the list) or n (I don't want to delete this word from the list and append the list)
y
n
The purpose is to use it kinda like flash cards.
For example, printed output from my list for learning Spanish:
python : pitón
If i memorise the item, I will enter y to delete the item from my list. If I need more practice, I will enter n to append the item the list.
Here's the example of the code that works fine.
words = ['bacon','eggs','bread','cheese','sausage','juice','butter',] def mylist(): a_word = words[0] yes_or_no = input(a_word) if yes_or_no == "n": words.append(words.pop(0)) elif yes_or_no == "y": del words[0] x = 1 while (x < 8): mylist() x = x + 1
Example output:
>>> bacon y >>> eggs n >>> bread y >>> cheese n >>> sausage y >>> juice n >>> butter y >>> print(words) >>> ['eggs', 'cheese', 'juice']
So my question is: How do I get python to save the modified list, so that when I run the program again it will load the appended list?
With the example above, if I open the the program next time, the list would only contain:
['eggs', 'cheese', 'juice']
but not the original:
['bacon','eggs','bread','cheese','sausage','juice','butter']
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.