From 13da4c996a63bc993886bd2cc20ccb32aaba473a Mon Sep 17 00:00:00 2001 From: Riya Dhami Date: Wed, 3 Jun 2026 18:43:53 +0545 Subject: [PATCH 1/4] Day 5 --- day 3.txt | 9 +++++++++ day5.py | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 day5.py diff --git a/day 3.txt b/day 3.txt index 16e1ad2..84db253 100644 --- a/day 3.txt +++ b/day 3.txt @@ -50,3 +50,12 @@ sets, list, tuples #learnt about dictionary, boolean data type, binary data type. #swap and delete in python is so easy. about operator and all + +#jun 3 - day 5 +Type Casting +Type casting is explicitly converting a variable from one data type to another using built-in functions like int, float, str + +Conditional statements like if-else, if elif-else: +Nested a loop . + + diff --git a/day5.py b/day5.py new file mode 100644 index 0000000..544dc16 --- /dev/null +++ b/day5.py @@ -0,0 +1,38 @@ +age_input = "19" #here it is string data type + +#age = age_input+1 #ERROR: Can not add number to a string +#print(age) + +#solution: type casting +age_input = int(age_input) #type casted to integer + +print(age_input + 1) + +raw_score = "3.96" + +#Casting string to float +final_score = float(raw_score) +print(f"Converted {raw_score} to float: {final_score}") + + +user_score = float(input("Enter your GPA score(0.00 - 4.00): ")) + +#Conditional decision making: +if user_score >= 3.60: + print("Good Peformance | A Grade") +elif user_score >= 3.00: + print("Solid work | B Grade") +elif user_score >= 2.00: + print("Satisfactory | C Grade") +else: + print("Needs Improvement | D Grade") + +user_input = input("Enter any integer to check if it is even or odd:") + +#checking using nested loops: +if user_input.isdigit(): #checking if the input is a digit + number = int(user_input) #type casted to integer + if number % 2 == 0: + print(f"{number} is an even number.") + else: + print(f"{number} is an odd number.") \ No newline at end of file From f5381bc1bf9d2aab271948cdcffba1c394912be0 Mon Sep 17 00:00:00 2001 From: Riya Dhami Date: Thu, 4 Jun 2026 13:41:47 +0545 Subject: [PATCH 2/4] day6 --- day 3.txt | 1 + day6.py | 22 ++++++++++++++++++++++ projec.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 day6.py create mode 100644 projec.py diff --git a/day 3.txt b/day 3.txt index 84db253..78d2d9b 100644 --- a/day 3.txt +++ b/day 3.txt @@ -58,4 +58,5 @@ Type casting is explicitly converting a variable from one data type to another u Conditional statements like if-else, if elif-else: Nested a loop . +Jun 4 - day 6 diff --git a/day6.py b/day6.py new file mode 100644 index 0000000..a8c07ee --- /dev/null +++ b/day6.py @@ -0,0 +1,22 @@ +#DAY 6 + +# input +raw_name = input("Enter your full name: ") + +# Cleaning the data +clean_name = raw_name.strip().title() + +# Using the data in a logical check +department = input("Enter your department (CSE/CE/AR): ").strip().upper() + +print(f"\n--- Student Profile Created ---") +print(f"Name: {clean_name}") +print(f"Department: {department}") + +# 4. Checking content within strings +email = input("Enter your email address: ").strip().lower() + +if "@" in email and email.endswith(".com"): + print("Email Status: Valid format.") +else: + print("Email Status: Invalid. Please check your email entry.") \ No newline at end of file diff --git a/projec.py b/projec.py new file mode 100644 index 0000000..c51d3f7 --- /dev/null +++ b/projec.py @@ -0,0 +1,29 @@ +print("-----Should I go to College?-(Bot)-----") + +#The initialize scenario +today_status = { + "is_raining": True, + "is_assignment_due" :False, + "is_practical_day": True +} + +#Input from user +energy_level = int(input("How is the energy level today(1-10): ")) +feeling_lazy = input("Are you feeling extra lazy today?(yes/no):").lower()=="yes" + +#Let's make a decision +print("\n--Decision Making--") + +if today_status["is_practical_day"] or today_status["is_assignment_due"]: + print("Verdict! YOU MUST GO Practical marks and assignments are too important to skip!") + +elif today_status["is_raining"] and feeling_lazy: + print("Verdict: STAY HOME. It's raining and you're tired. Perfect day for self-study in VS Code.") + +elif energy_level > 7 and not feeling_lazy: + print("Verdict: GO TO CLASS. You have the energy, don't waste the day!") + +else: + print("Verdict: YOUR CHOICE. Maybe just join the theory session and come back early.") + +print("\n==========================================") From f6558fb45bf3818fee3b53985e3e62cc2578a445 Mon Sep 17 00:00:00 2001 From: Riya Dhami Date: Fri, 5 Jun 2026 14:02:15 +0545 Subject: [PATCH 3/4] Day7 --- day7.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 day7.py diff --git a/day7.py b/day7.py new file mode 100644 index 0000000..ed8edd2 --- /dev/null +++ b/day7.py @@ -0,0 +1,38 @@ +print("-------------------------") +print("---System Registration---") +print("-------------------------") + +active = True + +registered_users = [] + +while active: + username = input("\nCreate a username.Or type 'exit' to quit: ").strip().lower() + + if username == "exit": + print("Closing registration system") + break #Loop ends immediately. + + if len(username) < 4: + print("⚠️ Error: Username must be at least 4 characters long.") + continue # skips the rest of the code, it goes to the top + + #only if the input passes validation above + print(f"✅ Username '{username}' is available!") + + #storing users into a list + registered_users.append(username) + + current_count = len(registered_users) + print(f"Total users registered till now are: {current_count}") + + #adding more users + choice = input("Register another user?(yes/no): ").strip().lower() + if choice != "yes": + active = False + #since the while runs for the true so the loop will end if user puts anything beside yes + +print("\nSystem shut down successfully.") +print("\n---Final Database Summary---") +print(f"Total successfull registrations: {len(registered_users)}") +print(f"Registered List: {registered_users}") \ No newline at end of file From 90a41f7d2c4deb2dbdd94c5cd56b57d655d0cdee Mon Sep 17 00:00:00 2001 From: Riya Dhami Date: Fri, 5 Jun 2026 14:11:29 +0545 Subject: [PATCH 4/4] comments --- day 3.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/day 3.txt b/day 3.txt index 78d2d9b..b286a0d 100644 --- a/day 3.txt +++ b/day 3.txt @@ -59,4 +59,12 @@ Conditional statements like if-else, if elif-else: Nested a loop . Jun 4 - day 6 +string mehtods like strip(), lower(),title()] +the input dyanmics + +Jun5 - day 7 +while condition with boolean flags +break and continue usage +append() and len() function uses +list use