Skip to content

Data-Analytics-with-Python/emoji-mapping-exercise-kotuzajl

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Review Assignment Due Date

Assignment: Emoji Translator

https://github.com/zhouy185/emoji_mapping/blob/main/emoji_map.ipynb

In this exercise, you will build a simple emoji translator in Python. The goal is to replace certain emotion adjectives (like happy, sad, angry) with matching emojis.

Task

You are given a dictionary of words mapped to emojis:

EMOJI_MAP = {
    "happy": "๐Ÿ˜€",
    "joyful": "๐Ÿ˜„",
    "excited": "๐Ÿคฉ",
    "proud": "๐Ÿ˜Œ",
    "calm": "๐Ÿ™‚",
    "confident": "๐Ÿ˜Ž",
    "playful": "๐Ÿ˜œ",
    "silly": "๐Ÿคช",
    "angry": "๐Ÿ˜ก",
    "frustrated": "๐Ÿ˜ค",
    "sad": "๐Ÿ˜ข",
    "lonely": "๐Ÿฅบ",
    "scared": "๐Ÿ˜ฑ",
    "worried": "๐Ÿ˜Ÿ",
    "tired": "๐Ÿ˜ด",
    "confused": "๐Ÿค”",
    "surprised": "๐Ÿ˜ฎ",
    "loving": "โค๏ธ",
    "grateful": "๐Ÿ™"
}

Write Python codes in emoji_map.ipynb to:

  • Splits the input text into words.

  • Replaces words found in EMOJI_MAP with their emoji.

  • Keeps all other words unchanged.

For example, "I am happy but also tired" will be converted to "I am ๐Ÿ˜€ but also ๐Ÿ˜ด"


๐Ÿ“ Before You Begin

  • Make sure you have a GitHub account (sign up with your McMaster email at https://github.com/join).
  • Accept the assignment link provided in GitHub Classroom.
  • A private repository will be created for you automatically.

๐Ÿš€ How to Work on the Assignment

Step 1: Open the Notebook in Colab

  1. Go to your private assignment repository on GitHub.
  2. Click on emoji_map.ipynb.
  3. Click the "Open in colab" badge. If not visible, then in the browserโ€™s address bar, replace https://github.com/ with https://colab.research.google.com/github/
  4. Press Enter โ†’ your notebook opens in Colab.

Step 2: Do the Assignment

  • Edit the code cells in Colab.
  • Run the cells to test your work.
  • Changes are only in Colab until you save them back to GitHub.

Step 3: Submit (Save Back to GitHub)

  1. In Colab, click File โ†’ Save a copy in GitHub.
  2. In the dialog:
  • Repository: choose your private assignment repo (e.g., emoji_mapping-username).
  • File path: keep it as emoji_map.ipynb.
  • Commit message: write something like "Finished assignment" or "Update notebook".
  1. Click OK.
  2. Your updated notebook is now saved to GitHub.

About

data-analytics-with-python-classroom-1a8e1c-emoji-mapping-exercise-emoji_mapping created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%