Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.41 KB

README.md

File metadata and controls

34 lines (24 loc) · 1.41 KB

Morse Code Encoder/Decoder

This is a simple Python-based Morse code encoder and decoder. The program allows users to input either a string of text or Morse code, and it will convert the input to the opposite format (from text to Morse code, or from Morse code to text).

Features

  • Encode: Convert plain text (letters, numbers, and space) into Morse code.
  • Decode: Convert Morse code back into plain text.
  • Supports: Lowercase and uppercase letters (both treated the same), numbers (0-9), and spaces.

Usage

  1. Run the Program: Simply run the script, and you'll be prompted to either encode or decode a message.

  2. Encoding:

    • To encode a message, input any combination of letters, numbers, or spaces.
    • The program will convert the message into Morse code, with each Morse code symbol separated by a space.
  3. Decoding:

    • To decode a Morse code message, input a string of Morse code symbols. Symbols should be separated by spaces.
    • The program will convert the Morse code back into the original message.
  4. Exit:

    • To exit the program, type # when prompted.

How to Run

  1. Ensure you have Python installed (version 3.x is recommended).

  2. Copy the code from morse_code.py (or your script) into a Python file.

  3. Open a terminal or command prompt and navigate to the directory containing the Python script.

  4. Run the program using:

    python morse_code.py