Combine Days 1-6. Write a program that greets the user, asks for a password, and if correct, runs the simple calculator.
Sample Code:
name = input("Enter your name: ")
print("Hello, " + name + "! Welcome to the 40-day challenge!")
password = input("Enter password: ")
if password == "detsoftwares123":
print("Access granted")
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
print("Sum:", num1 + num2)
print("Difference:", num1 - num2)
print("Product:", num1 * num2)
print("Quotient:", num1 / num2)
else:
print("Access denied")Students, Day 7 ties it all together—review by combining! Start with Day 1: Input name, print greeting with concatenation. Then Day 6: Input password, if checks == "python123". If true, "Access granted" and dive into Day 2 calculator: Input two floats, print sum (+), difference (-), product (*), quotient (/). If wrong, "Access denied" via else—no calculator.
It's modular: Greeting always runs, then conditional gates the rest. Indentation keeps the calculator inside the if. Run: Name, greeting, password—if correct, math; else, denied. In 10-15 min, add Day 4 even/odd to one result, or FizzBuzz after. This shows code builds on itself—great job reviewing fundamentals!
