Day 1: Hello, You!
Create a script that asks for the user's name and then prints a personalized greeting. "Hello, [Name]! Welcome to the 40-day challenge!" (Concepts: input(), print(), string concatenation)
Sample Code:
name = input("Enter your name: ")
print("Hello, " + name + "! Welcome to the 40-day challenge!")Hey students, welcome to Day 1! We're starting super simple to get you comfortable with Python's basics. This script is all about interacting with the user. First, we use the input() function—it pauses the program and waits for you to type something in the console, then stores what you enter as a string in the variable name. Think of a variable like a box that holds data; here, name holds whatever you input.
Next, the print() function outputs text to the screen. Inside it, we're concatenating strings using the + operator. "Hello, " is a fixed string, then we add the name variable, and finally another string "! Welcome to the 40-day challenge!". Python glues them together seamlessly. If you run this, type your name (e.g., "Alex"), and it'll print "Hello, Alex! Welcome to the 40-day challenge!".
Key tip: input() always returns a string, even if you enter numbers—we'll handle that later. Try modifying it: What if you want to add their age? Spend your 10-15 minutes experimenting, and if stuck, check Python docs for input(). Great job starting the habit!
