The Personal Information Calculator is a Python program that collects various personal information from the user, such as their name, email, and age, and then calculates and displays several time-related metrics based on the user's age.
- Installation and Setup
- Usage
- Code Structure
- Comments and Documentation
- Future Enhancements
- Contributing
- Contact
This program requires Python 3.x to be installed on your system. To run the program, simply save the code to a file (e.g., personal_info_calculator.py
) and execute it using the following command:
python personal_info_calculator.py
When you run the program, it will prompt you to enter the following information:
- Your first name
- Your middle name
- Your last name
- Your email address
After you provide this information, the program will display:
- Your full name
- Your username, website, and domain (extracted from the email address)
- Your age in years
- The number of months, weeks, days, hours, minutes, and seconds you have lived
Finally, the program will thank you for using it.
The code is organized into the following sections:
- Greeting and Name Collection: The program starts by printing the title and collecting the user's first, middle, and last name.
- Email Processing: The program then collects the user's email address and extracts the username, website, and domain.
- Age and Time Metrics Calculation: The program collects the user's age and calculates various time-related metrics (months, weeks, days, hours, minutes, seconds).
- Output Formatting and Display: The program formats the output and displays the user's information and the calculated time metrics.
- Closing Message: The program concludes by thanking the user for their experience.
The code includes detailed comments that explain the purpose and functionality of each section. These comments are designed to make the code more self-documenting and easier for others (or your future self) to understand and maintain.
Future enhancements to this program could include:
- Validating user input to handle invalid or incomplete data
- Allowing the user to save their personal information to a file or database
- Implementing additional time-related calculations (e.g., years, decades)
- Providing the option to calculate the user's lifespan based on average life expectancy
If you find any issues or have suggestions for improvements, please feel free to submit a GitHub issue or a pull request. Contributions are welcome and appreciated!
If you have any questions or feedback, you can reach me at [mm.talal-95@yahoo.com] or through my GitHub profile at [https://github.com/MMTalal].