Ask the user for a password. If the password is "detsoftwares123", print "Access granted". Otherwise, print "Access denied". (Concepts: conditionals, comparison operators ==)
Sample Code:
password = input("Enter password: ")
if password == "detsoftwares123":
print("Access granted")
else:
print("Access denied")Day 6, folks—security basics with conditionals! Simple: input() gets the password as a string, stored in password.
The if checks password == "detsoftwares123"—== compares for exact match (case-sensitive, so "detsoftwares123" fails). If true, print "Access granted". else catches everything else: "Access denied". No loops or math, just decision-making.
Try it: Right password unlocks, wrong denies. In 10-15 min, make it case-insensitive with .lower() (e.g., password.lower() == "detsoftwares123"). Or add a retry? This mimics logins; conditionals control flow. Keep practicing—you're securing code now!
