Creating a Simple Login System with Conditions in Python

Day 6/30 Some concepts look basic… but they are the foundation of real-world systems. 🔹 Problem: Create a simple login system (check username & password) 🔹 What I focused on today: Understanding how validation and conditions work together 🔹 My Thinking Process: Store a predefined username and password Take input from user Compare input with stored values Display success or error message 👉 Small logic, but widely used in real applications 🔹 Inputs I used: Username Password 🔹 Code: Stored_username = "admin" Stored_password = "1234" username = input("Enter username: ") password = input("Enter password: ") if username == Stored_username and password == Stored_password: print("Login Successful!") else: print("Invalid Username or Password") 🔹 Example: Username = admin Password = 1234 Output → Login Successful 🔹 Key Takeaway: Even simple programs can represent real-world systems like authentication, which rely heavily on condition checking #Day6 #Python #30DaysOfCode #LearningInPublic #DataAnalytics #ProblemSolving

  • text

To view or add a comment, sign in

Explore content categories