Skip to content

RAMA-L7/MORSE_CODE-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Morse Code Encoder & Decoder

This is a simple Python script that allows users to encode a message into Morse code or decode a Morse code message back into English.

πŸ”€ Features

  • Encode English text into Morse code
  • Decode Morse code into English text
  • Supports letters A–Z and numbers 0–9
  • Uses _ to represent space between words in encoding

πŸ“Œ Usage

  1. Run the Python script.
  2. Enter your message.
  3. Choose:
    • 1 for encoding (text ➝ Morse)
    • 2 for decoding (Morse ➝ text)

Example: Encoding

Input: enter your message: hello world 1 - for ENCODING 2 - for DECODING enter your option: 1

Output: .... . .-.. .-.. --- _ .-- --- .-. .-.. -..

Example: Decoding

Input: enter your message: .... . .-.. .-.. --- _ .-- --- .-. .-.. -.. 1 - for ENCODING 2 - for DECODING enter your option: 2

Output: HELLOWORLD

🧠 How It Works

  • A dictionary morse_code maps letters and numbers to Morse symbols.
  • Another dictionary alpha_code is auto-generated to reverse this mapping for decoding.
  • Encoding processes each character of the input string.
  • Decoding splits the Morse input by spaces and maps it back to text.

πŸ› οΈ Requirements

Just Python! No external libraries are required.

πŸ—‚οΈ File

  • morse_code.py β€” main script for encoding and decoding

πŸ“„ License

This project is open-source and free to use under the MIT License.

About

first project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages