// projects.python
10 Best Python Projects
Hand-picked and ordered easiest → hardest — each with complete code and expected output. Build these to turn lessons into a portfolio.
Back to Python course
// solution.code
python
# Personal Greeting Program
# This program asks for user information and displays personalized greetings
def main():
# Print welcome message
print("=" * 50)
print("Welcome to the Personal Greeting Program!")
print("=" * 50)
# Get user input
name = input("\nWhat is your name? ")
age = input("How old are you? ")
city = input("Which city do you live in? ")
hobby = input("What is your favorite hobby? ")
# Display personalized greetings using different string formatting methods
print("\n" + "=" * 50)
print("PERSONALIZED GREETINGS")
print("=" * 50)
# Using f-strings (Python 3.6+)
print(f"\nHello, {name}! It's wonderful to meet you!")
# Using .format() method
print("At {} years old, you have so much ahead of you!".format(age))
# Using concatenation
print("Living in " + city + " must be exciting!")
# Using multiple variables in f-string
print(f"I hope you get plenty of time to enjoy {hobby} in {city}!")
# Final personalized message
print(f"\nHave a fantastic day, {name}! Keep enjoying {hobby}!")
print("=" * 50)
if __name__ == "__main__":
main() output
================================================== Welcome to the Personal Greeting Program! ================================================== What is your name? Alice How old are you? 25 Which city do you live in? Seattle What is your favorite hobby? painting ================================================== PERSONALIZED GREETINGS ================================================== Hello, Alice! It's wonderful to meet you! At 25 years old, you have so much ahead of you! Living in Seattle must be exciting! I hope you get plenty of time to enjoy painting in Seattle! Have a fantastic day, Alice! Keep enjoying painting! ==================================================
