Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Age-Calculator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Age Calculator – Beginner Python Project

This is a simple Python project for beginners to calculate a person's age based on the birth year.

## File Structure

- `age_calculator.py` – Contains the logic to calculate age from the user's input.

## ✅ How It Works

1. The user is asked to enter their **birth year**.
2. The program calculates the current year using Python's `datetime` module.
3. It subtracts the birth year from the current year to get the **age**.
4. The age is then printed on the screen.

## Skills You'll Learn

- Taking input from users
- Working with Python's `datetime` module
- Defining and calling functions
- Basic math and string formatting

## Run the Code

Open terminal and run:

```bash
python age_calculator.py

Then enter your birth year (e.g., 2000) and get your age.
Happy Coding! 🎉
12 changes: 12 additions & 0 deletions Age-Calculator/age_calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from datetime import date

def calculate_age(birth_year):
current_year = date.today().year
age = current_year - birth_year
return age

# Ask user for their birth year
birth_year = int(input("Enter your birth year: "))
age = calculate_age(birth_year)

print(f"You are {age} years old.")
34 changes: 34 additions & 0 deletions hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Hello World in Python

This is a simple beginner-friendly Python project that prints a personalized "Hello, World" message.

## File: `hello.py`

This script asks for the user's name and prints a greeting.

### How it works:
- Takes input from the user
- Uses a function `say_hello(name)` to return a greeting message
- Prints the final message

### To run:
```bash
python hello.py

Example Output:
Enter your name: Shailaja
Hello, Shailaja! Welcome to the world of open source.


🌟 Who is this for?
Perfect for first-time contributors to practice creating a Python script and contributing to open-source.


Contribution Steps:

Fork the repo
Clone to your system
Create a branch
Add your project
Commit and push
Create a Pull Request (PR)
Comment on lines +1 to +34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove any files that are not relevant to the PR.

Suggested change
# Hello World in Python
This is a simple beginner-friendly Python project that prints a personalized "Hello, World" message.
## File: `hello.py`
This script asks for the user's name and prints a greeting.
### How it works:
- Takes input from the user
- Uses a function `say_hello(name)` to return a greeting message
- Prints the final message
### To run:
```bash
python hello.py
Example Output:
Enter your name: Shailaja
Hello, Shailaja! Welcome to the world of open source.
🌟 Who is this for?
Perfect for first-time contributors to practice creating a Python script and contributing to open-source.
Contribution Steps:
Fork the repo
Clone to your system
Create a branch
Add your project
Commit and push
Create a Pull Request (PR)

7 changes: 7 additions & 0 deletions hello-world/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def say_hello(name):
return f"Hello, {name}! Welcome to the world of open source."

# Example usage
if __name__ == "__main__":
user_name = input("Enter your name: ")
print(say_hello(user_name))
Comment on lines +1 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove any files that are not relevant to the PR.

Suggested change
def say_hello(name):
return f"Hello, {name}! Welcome to the world of open source."
# Example usage
if __name__ == "__main__":
user_name = input("Enter your name: ")
print(say_hello(user_name))