An advanced Python program that demonstrates object-oriented programming, multiple languages, time-based greetings, and interactive menu systems.
- 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
- 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
- Python 3.6 or higher
- No external dependencies (uses only standard library)
Run the program with:
python3 greeting.py- Get a greeting - Personalized greeting with language and style options
- Show available languages - Display all supported languages and their greetings
- Get multiple greetings - Receive greetings in all languages
- Exit - Close the program
__init__(): Initialize language data and settingsget_time_of_day(): Determine current time periodget_random_greeting(): Select random greeting from languageget_time_based_greeting(): Get time-appropriate greetinggreet(): Main greeting function with multiple optionsget_user_name(): Handle user input with validationget_user_preferences(): Collect user choices for greeting styleshow_menu(): Display main program menushow_languages(): Display language informationget_multiple_greetings(): Generate greetings in all languagesrun(): Main program loop
| 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 |
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!
- 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
- Add more languages (Italian, Portuguese, Japanese)
- Implement user preference saving
- Add greeting history tracking
- Create GUI version
- Add voice output capabilities
This project is open source and available under the MIT License.