https://github.com/seandadonntech/yearcal
https://github.com/seandadonntech/yearcal
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/seandadonntech/yearcal
- Owner: seandadonntech
- Created: 2024-02-04T16:01:11.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-04T16:01:29.000Z (over 1 year ago)
- Last Synced: 2025-01-17T21:08:25.786Z (5 months ago)
- Language: Python
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# yearcal
## Description
This Python script takes the current year and your age as input and calculates the year you were born. It then determines whether you are an adult or a minor based on the calculated birth year.## How to Use
1. Run the script by executing the provided code in a Python environment.
2. Enter the current year and your age when prompted.
3. The script will calculate and display the year you were born and determine if you are an adult or a minor.## Script Explanation
The script uses the current year and your age to calculate your birth year. It then checks if you are 18 years or older to determine whether you are an adult or a minor.```python
year = int(input("Please enter the current year: "))
age = int(input("Please enter your age: "))birth_year = year - age
print(f"You were born in the year {birth_year}")if birth_year >= 18:
print("You are an adult.")
else:
print("You are a minor.")