
import json
words = {}
def save_data():
with open("students.json", "w") as f:
json.dump(words ,f)
def read_data():
global words
with open("students.json", "r") as f:
words = json.load(f)
def add_word():
new_word = input("Type a word.")
words[new_word] = {"meanings":[],
"examples": []}
while True:
print("""
1 Add meaning
2 Add example
3 Exit""")
choce = int(input("What do you want to do?"))
if choce ==1:
meaning = input("Type the meaning.")
words[new_word]["meanings"].append(meaning)
elif choce ==2:
example= input("Type the example.")
words[new_word]["examples"].append(example)
elif choce == 3:
break
else:
pass
save_data()
def show_words():
for word in words:
print()
print(f"Word: {word}")
print()
print("Meanings")
for meaning in words[word]["meanings"]:
print(meaning)
print()
print("Examples:")
print()
for example in words[word]["examples"]:
print(example)
def search():
word = input("Which word do you want to search?")
print()
print("Meanings")
for meaning in words[word]["meanings"]:
print(meaning)
print()
print("Examples:")
print()
for example in words[word]["examples"]:
print(example)
def main():
read_data()
while True:
print("""
1 Add a new word.
2 Show the word list.
3 Search a word.""")
choce = int(input("What do you want to do?"))
if choce ==1:
add_word()
elif choce ==2:
show_words()
elif choce ==3:
search()
else:
pass
main()
Python is a programming language that is intended for both total beginners who have never coded before and experienced programmers who wish to broaden their career choices by learning Python. Python is, in reality, one of the most widely used programming languages in the world, with major corporations such as Google using it in mission-critical systems such as Google Search to great effect. Python, on the other hand, is the most popular programming language for machine learning, data science, and artificial intelligence. If you want to get one of those high-paying positions, you'll need to be an expert in Python, which is exactly what you'll learn from this course.
Once you've completed the course, you'll be ready to submit applications with confidence for Python programming positions. And, sure, this is true even if you have never coded in your life before to now. You may become employable and useful in the eyes of future employers if you have the appropriate abilities, which you will acquire in this course and practice.
If you have any questions about this course, please contact me as soon as possible and I will respond to you the same day. With the help of this course, you will learn how to make your lives simpler by becoming familiar with the Python programming language. This will keep you motivated on a daily basis and prevent you from becoming bored while studying Python.