Overview
Generative AI is becoming increasingly intelligent, transforming how we access and value knowledge. In the realm of education, this technology has made knowledge cheaper and more accessible than ever before. This challenge will demonstrate the power of generative AI, particularly its potential to revolutionize learning in fields such as accounting. You will be tasked with using ChatGPT to create an accounting dictionary. Following that, you will utilize Python to develop a platform that enables you and other users to interact with this dictionary data, thereby facilitating a novel way to learn accounting.
Instructions
The data file gives you a list of accounting vocabulary and a blank “Explanation” column. Use ChatGPT to find out the explanations for these words. Copy and paste these explanations to the data file next to the word they describe. Try to prompt ChatGPT with phrases like “explain these as if you are explaining them to a 5-year-old child.” You can use different prompts according to your personal preference. Chat does better with small chunks: 10-20 terms.
After generating the dictionary, close the Excel file and open a coding environment, like Visual Studio Code, Jupyter Notebook, etc. You will use Python to create an interactive platform to learn from this dictionary.
Import pandas. Load in the data file as a pandas DataFrame. You can decide to keep the values as Pandas DataFrame or create a Python dictionary where the keys are the terms and the values are the explanations.
Prompt the user to type in the accounting word he/she want to learn and store that in a variable. Make sure you make that case insensitive.
If the word is in the dictionary, print out the explanation. After that, prompt user to answer if he/she wants to continue or not. If he/she wants to continue, repeat the process. If not, end the program.
If the word is NOT in the dictionary, tell the user the word is not in the dictionary and ask if the user wants to quit or continue. If he/she wants to continue, repeat the process. If he/she wants to quit, end the program.
def interactive_learning():
print(“Welcome to the Accounting Dictionary! Type a term to learn about it.”)
while True:
# Ask the user for a term
user_input = input("\nEnter an accounting term: ").strip().lower()
if user_input in accounting_dict:
# If the term exists, display its explanation
print(f"\nExplanation: {accounting_dict[user_input]}")
else:
# Inform the user if the term isn't in the dictionary
print("\nThe term is not in the dictionary.")
# Ask if the user wants to continue
continue_choice = input("\nDo you want to look up another term? (yes/no): ").strip().lower()
if continue_choice != 'yes':
print("\nThank you for using the Accounting Dictionary! Goodbye!")
break
Time to complete: 1 hour
Rating: Intermediate
Comments: I really enjoyed this case, I had some errors that I had to deal with relating to my laptop, and ChatGPT was very excellent at helping me to reconfigure my laptop so that I could complete this challenge. After dealing with those challenges, ChatGPT excelled at writing the code for my python file, I only had to iterate twice to get it functioning completely. Below is my solution:
import pandas as pd
Load the data file into a pandas DataFrame
file_path = “Challenge214_Accounting_Maestro.xlsx” # Update with the actual file name if different
data = pd.read_excel(file_path)
Create a dictionary where keys are terms and values are explanations
def learn_accounting_terms():
print(“Welcome to the Accounting Dictionary Interactive Platform!\n”)
while True:
# Prompt the user to input a term
term = input("Type an accounting word you want to learn: ").strip().lower()
# Check if the term is in the dictionary
if term in dictionary:
print(f"\nExplanation for '{term}': {dictionary[term]}\n")
else:
print(f"\nSorry, the word '{term}' is not in the dictionary.\n")
# Ask if the user wants to continue
continue_prompt = input("Do you want to continue? (yes/no): ").strip().lower()
if continue_prompt not in ['yes', 'y']:
print("\nThank you for using the Accounting Dictionary Interactive Platform! Goodbye!")
break
Time: 1 hour
Rating: Intermediate
Comments: I really enjoyed this challenge since it involved both using chatGPT to help me define the accounting terms in goofy ways and to help me code quicker. I still ended up taking an hour because I redid the first half of my terms to use a dinosaur theme in my explanations and I also tried to code on my own.
df = pd.read_excel("\Challenge214_Accounting Maestro ChatGPT.xlsx",sheet_name=0) # to update with own filepath
df.head()
def get_definition(word):
"""Finds the definition of the word/phrase in a case-insensitive way."""
word = word.lower() # Normalize input (remove spaces and make lowercase)
match = df[df["Term"].str.lower() == word] # Case-insensitive match
if not match.empty:
return match.iloc[0]["Explanation"]
else:
return None
def ask_to_continue():
"""Asks the user whether they want to continue or quit."""
while True:
user_input = input("Do you want to continue? (yes/no): ").lower()
if user_input in ["yes", "y"]:
return True
elif user_input in ["no", "n"]:
return False
else:
print("Invalid input! Please type 'yes' or 'no'.")
def play_game():
"""Runs the word definition lookup game with multi-word term support."""
print("🦕 Welcome to the Dino Dictionary Game! 🦖")
print("Type a word or phrase to get its definition.\n")
while True:
user_input = input("Enter a word or phrase: ")
definition = get_definition(user_input)
if definition:
print(f"📖 Definition: {definition}\n")
else:
print("Sorry, that word/phrase is not in our dino-dictionary! 🦖")
if not ask_to_continue():
print("Goodbye! Keep learning about dinosaurs and finance! 🦕")
break
# Start the game
play_game()
Time to complete: 1h
Rating: intermediate
Comments: really fun challenge that reminded me of the python class I had last semester which I really enjoyed. Even though I used chatgpt to code I still had to go back and fix some errors. It had me go back to my compiled codes from last semester.
import pandas as pd
import os
Load the data file into a pandas DataFrame
data_path = os.getcwd()+“\Accounting_Terms_Updated_Explanations.xlsx”
data = pd.read_excel(data_path)
Create a dictionary where terms are keys and explanations are values
while True:
# Prompt the user to type in the accounting word they want to learn
user_input = input("Type an accounting word you want to learn: ").strip().lower()
if user_input in terms_dict:
# If the word is in the dictionary, print the explanation
print(f"\n{user_input.title()}: {terms_dict[user_input]}\n")
else:
# If the word is not in the dictionary
print("\nSorry, that word is not in the dictionary.\n")
# Ask the user if they want to continue or quit
continue_choice = input("Do you want to continue? (yes/no): ").strip().lower()
if continue_choice != "yes":
print("\nGoodbye! Have a great day learning accounting!\n")
break
Time to complete: 1 hour
Rating: Intermediate
Comments:
I enjoyed the case; it was a great refresher on the Python class I took last year. It took about an hour to complete, as I tested different words to ensure the code was working correctly. It was fascinating to see how combining two tools can create an interactive, personalized solution that’s useful for school. chatgpt Case
import os
location = os.getcwd()+“\Accounting_Terms_Updated_Explanations.xlsx”
import pandas as pd
Load the data file into a pandas DataFrame
data = pd.read_excel(“Accounting_Terms_Updated_Explanations.xlsx”)
terms_dict = {term.lower(): explanation for term, explanation in zip(data[‘Term’], data[‘Explanation’])}
while True:
word = input(“Enter an accounting term to learn (or ‘quit’ to exit): “).strip().lower()
if word == ‘quit’:
print(“Goodbye! Have a great day learning accounting!”)
break
explanation = terms_dict.get(word)
if explanation:
print(f”\n{word.title()}: {explanation}\n”)
else:
print(“\nSorry, that word is not in the dictionary.\n”)
while True:
# Prompt the user to type an accounting word
user_input = input("Enter an accounting term you want to learn about: ").strip().lower()
# Check if the word is in the dictionary
if user_input in map(str.lower, terms_dict.keys()):
# Find the correct case-sensitive key
key = next(term for term in terms_dict if term.lower() == user_input)
print(f"\n{key}: {terms_dict[key]}\n")
else:
print("\nThe word is not in the dictionary.\n")
# Ask if the user wants to continue
continue_choice = input("Do you want to continue? (yes/no): ").strip().lower()
if continue_choice not in ["yes", "y"]:
print("Goodbye!")
break
Time to complete: 1 hr
Rating: Intermediate
Comments: I thought that this was a fun challenge. The accounting definitions that ChatGPT came up with were funny. This was also a good test of basic python knowledge and how to prompt ChatGPT for more specific results.
import pandas as pd
def load_data(file_path):
"""Load the Excel file as a DataFrame and convert it to a dictionary."""
df = pd.read_excel(file_path)
terms_dict = dict(zip(df['Term'].str.lower(), df['Explanation'])) # Convert terms to lowercase
return terms_dict
def define():
"""Main function to interact with the user."""
# Load the data file
file_path = "path_to_your_excel_file.xlsx" # Replace with your actual file path
terms_dict = load_data(file_path)
print("Welcome to the Accounting Dictionary!\n")
while True:
# Prompt user for an accounting term
term = input("Type the accounting word you want to learn: ").strip().lower()
# Check if the term is in the dictionary
if term in terms_dict:
print(f"\nDefinition of '{term}': {terms_dict[term]}\n")
else:
print(f"\nSorry, the word '{term}' is not in the dictionary.\n")
# Ask the user if they want to continue
choice = input("Do you want to continue? (yes/no): ").strip().lower()
if choice not in ['yes', 'y']:
print("Goodbye!")
break
if __name__ == "__main__":
define()
I had an enjoyable time completing this challenge. I hadn’t done any python work in a long time and it took awhile to break off the cobwebs.
def get_definition(word, terms_dict):
“”"
Finds the definition of the word/phrase in a case-insensitive way.
“”"
word = word.lower().strip() # Normalize input
if word in terms_dict:
return terms_dict[word]
else:
return None
def ask_to_continue():
“”"
Asks the user whether they want to continue or quit.
“”"
while True:
choice = input("Do you want to continue? (yes/no): ").strip().lower()
if choice in [“yes”, “y”]:
return True
elif choice in [“no”, “n”]:
return False
else:
print(“Invalid input! Please type ‘yes’ or ‘no’.”)
def define(file_path):
“”"
Main function to interact with the user.
“”"
# Load the data file and create a dictionary
terms_dict = load_data(file_path)
print("Welcome to the Accounting Dictionary!\n")
print("Type a word to learn its explanation.\n")
while True:
# Prompt user for an accounting term
term = input("Enter an accounting word: ").strip()
definition = get_definition(term, terms_dict)
# Display the result or an error message
if definition:
print(f"\nDefinition of '{term}': {definition}\n")
else:
print(f"\nSorry, the word '{term}' is not in the dictionary.\n")
# Ask the user if they want to continue
if not ask_to_continue():
print("Goodbye! Keep learning about accounting!")
break
if name == “main”:
file_path = “Challenge214_Accounting Maestro ChatGPT.xlsx” # Replace with your file path
define(file_path)
Time to complete: 45 min
Rating: intermediate
This was actually super cool. What I did was I actually used chat gpt to take all the terms and make it into a whole new excel file the prompt I gave it was:
“this is in an excel sheet can you create a brand new excel sheet with each of the terms and a definition that matches that would make sense to a freshman in high school?”
Then it created a whole new file with terms. I think if doing this for an important project it will be important to make sure all the terms are 100% correct. The terms that I got were mostly correct but not the best explanation possible but it would be pretty easy to correct them.
Then I basically just gave chat the same exact instructions that I had from this challenge and it spit out a code that almost worked I just had to make the file path work. Then it worked great. It is cool how you can use so many platforms for studying.