Skip to content

MihaiPosea/python-greeting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Enhanced Greeting Program 🌍

An advanced Python program that demonstrates object-oriented programming, multiple languages, time-based greetings, and interactive menu systems.

✨ Features

Core Features

  • Multi-language Support: Greetings in English, Spanish, French, and German
  • Time-based Greetings: Automatic time-of-day appropriate greetings
  • Interactive Menu System: User-friendly command-line interface
  • Random Greetings: Variety of greeting styles per language
  • Input Validation: Robust error handling and input validation

Advanced Features

  • Object-Oriented Design: Clean class-based architecture
  • Type Hints: Full type annotation for better code clarity
  • Multiple Greeting Modes: Random, time-based, and custom greetings
  • Language Explorer: View all available languages and their greetings
  • Batch Greetings: Get greetings in all supported languages at once

🚀 Requirements

  • Python 3.6 or higher
  • No external dependencies (uses only standard library)

📖 Usage

Run the program with:

python3 greeting.py

Menu Options

  1. Get a greeting - Personalized greeting with language and style options
  2. Show available languages - Display all supported languages and their greetings
  3. Get multiple greetings - Receive greetings in all languages
  4. Exit - Close the program

🏗️ Code Structure

GreetingProgram Class

  • __init__(): Initialize language data and settings
  • get_time_of_day(): Determine current time period
  • get_random_greeting(): Select random greeting from language
  • get_time_based_greeting(): Get time-appropriate greeting
  • greet(): Main greeting function with multiple options
  • get_user_name(): Handle user input with validation
  • get_user_preferences(): Collect user choices for greeting style
  • show_menu(): Display main program menu
  • show_languages(): Display language information
  • get_multiple_greetings(): Generate greetings in all languages
  • run(): Main program loop

🌍 Supported Languages

Language Code Sample Greetings
English en Hello, Hi, Hey, Greetings
Spanish es Hola, Buenos días, Saludos
French fr Bonjour, Salut, Bonsoir
German de Hallo, Guten Tag, Grüß Gott

📝 Example Output

Welcome to the Enhanced Greeting Program!
This program offers greetings in multiple languages and styles.

==================================================
🎉 ENHANCED GREETING PROGRAM 🎉
==================================================
1. Get a greeting
2. Show available languages
3. Get multiple greetings
4. Exit
--------------------------------------------------
Choose an option (1-4): 1

What's your name? John

Greeting Options:
1. Random greeting
2. Time-based greeting
3. Custom greeting
Choose greeting type (1-3, default: 1): 2

Language Options:
1. English (en)
2. Spanish (es)
3. French (fr)
4. German (de)
Choose language (1-4, default: 1): 2

Buenas tardes, John!

🛠️ Development

Recent Enhancements

  • Added multi-language support (4 languages)
  • Implemented time-based greeting logic
  • Created interactive menu system
  • Added input validation and error handling
  • Enhanced with emojis and better formatting
  • Object-oriented refactoring for better maintainability

Future Enhancements

  • Add more languages (Italian, Portuguese, Japanese)
  • Implement user preference saving
  • Add greeting history tracking
  • Create GUI version
  • Add voice output capabilities

📄 License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages