From 57be73ab89256d1c2f5807c36c2373a1df9f8fe1 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 31 Jul 2025 19:36:35 +0530 Subject: [PATCH 01/35] band-generator.py --- Day 1/band-generator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Day 1/band-generator.py b/Day 1/band-generator.py index 48538d9..ef35ece 100644 --- a/Day 1/band-generator.py +++ b/Day 1/band-generator.py @@ -1,14 +1,14 @@ #1. Create a greeting for your program. -print("Hello there! Welcome to Band Generator.") +print("welcome to Day 1 of 100 days of Python") #2. Ask the user for the city that they grew up in. -city = input("Please tell us your city name. \n") +city = input("In which city you grew in?\n") #3. Ask the user for the name of a pet. -pet = input("Please tell us your pet's name. \n") +pet = input("What is name of your pet? \n") #4. Combine the name of their city and pet and show them their band name. band_name = f"{city} {pet}" #5. Make sure the input cursor shows on a new line. -print(f"Your band name should be {band_name}.") \ No newline at end of file +print(f"Your band name should be {band_name}.") From 39b81600313699b45fc2064cda2f927e087d76a2 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 31 Jul 2025 19:39:39 +0530 Subject: [PATCH 02/35] exercise1.py --- Day 1/exercise1.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Day 1/exercise1.py b/Day 1/exercise1.py index 02441a6..88b5c1f 100644 --- a/Day 1/exercise1.py +++ b/Day 1/exercise1.py @@ -1,5 +1,4 @@ '''Write a program in main.py that prints the some notes from the previous lesson using what you have learnt about the Python print function.''' -print("100 Days of Python") +print("I am doing the challenge 100 Days of Python") print("This is the Day 1.") -print("We can print single quotes like this ' '.") \ No newline at end of file From 09251b4caf4ef55469091aa0ff30bb53ad39c14f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 31 Jul 2025 19:41:38 +0530 Subject: [PATCH 03/35] exercise2.py --- Day 1/exercise2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Day 1/exercise2.py b/Day 1/exercise2.py index b7ed4b3..8819a96 100644 --- a/Day 1/exercise2.py +++ b/Day 1/exercise2.py @@ -11,7 +11,7 @@ print('e.g. print("Hello " + "world")') print(("New lines can be created with a backslash and n.") ''' - +#Fixed print("Day 1 - String Manipulation") print('String Concatenation is done with the "+" sign.') print('e.g. print("Hello " + "world")') @@ -68,4 +68,4 @@ def test_1(self): print(".\n.\n.") unittest.main(verbosity=1, exit=False) -os.remove("testing_copy.py") \ No newline at end of file +os.remove("testing_copy.py") From d1185caef56fbc08639d9924eb9e013bf78d783f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 31 Jul 2025 19:43:29 +0530 Subject: [PATCH 04/35] exercise3.py --- Day 1/exercise3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Day 1/exercise3.py b/Day 1/exercise3.py index 4f35884..aff5188 100644 --- a/Day 1/exercise3.py +++ b/Day 1/exercise3.py @@ -3,4 +3,4 @@ ''' string = input("Enter the string : ") -print(len(string)) \ No newline at end of file +print(len(string)) From 00640a22aa5d85aa3881bda3d45e98e04d813a94 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 31 Jul 2025 19:44:37 +0530 Subject: [PATCH 05/35] exercise4.py --- Day 1/exercise4.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Day 1/exercise4.py b/Day 1/exercise4.py index 23c59cf..d1d7c45 100644 --- a/Day 1/exercise4.py +++ b/Day 1/exercise4.py @@ -1,5 +1,5 @@ '''Write a program that switches the values stored in the variables a and b.''' -a, b = map(int, input().split(" ")) -a, b = b, a -print(a, b) +x, y = map(int, input().split(" ")) +x, y = y, x +print(x, y) From ceb5676010d8066a639315048489f3a4d124f0e0 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 31 Jul 2025 19:45:07 +0530 Subject: [PATCH 06/35] main.py --- Day 1/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Day 1/main.py b/Day 1/main.py index 1eaa088..f301245 100644 --- a/Day 1/main.py +++ b/Day 1/main.py @@ -1 +1 @@ -print("Hello World !") \ No newline at end of file +print("Hello World!") From aa62cac0490c9834c7fa958fa3f32f22599bab95 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Fri, 1 Aug 2025 20:30:58 +0530 Subject: [PATCH 07/35] exercise1.py --- Day 2/exercise1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Day 2/exercise1.py b/Day 2/exercise1.py index 88fdf71..c31e354 100644 --- a/Day 2/exercise1.py +++ b/Day 2/exercise1.py @@ -11,4 +11,4 @@ sum = int(two_digit_number[0])+int(two_digit_number[1]) print(f"Sum of digits of {two_digit_number} is {sum}.") except ValueError: - print("Please enter an integer.") + print("Please enter only two digit integer.") From cf30f83563352b5a834617a0d369d6aa14aa50b0 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Fri, 1 Aug 2025 20:42:57 +0530 Subject: [PATCH 08/35] exercise2.py --- Day 2/exercise2.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Day 2/exercise2.py b/Day 2/exercise2.py index b21d7ce..e8c9feb 100644 --- a/Day 2/exercise2.py +++ b/Day 2/exercise2.py @@ -13,7 +13,11 @@ # Write your code below this line 👇 try: - bmi = float(weight)/(float(height)**2) - print(f"Your BMI is {bmi}.") + height = float(height) + weight = float(weight) + + bmi = weight / (height ** 2) + print("Your BMI is:", round(bmi, 2)) + except ValueError: - print("Please enter integer or float values only.") + print("Invalid input. Please enter numeric values only.") From a7bc441766abc746f04a419efdcdb70e7893e675 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Fri, 1 Aug 2025 20:51:59 +0530 Subject: [PATCH 09/35] exercise3.py --- Day 2/exercise3.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Day 2/exercise3.py b/Day 2/exercise3.py index 51aa71a..8dd37aa 100644 --- a/Day 2/exercise3.py +++ b/Day 2/exercise3.py @@ -8,6 +8,16 @@ Where x, y and z are replaced with the actual calculated numbers. ''' +''' +Create a program using maths and f-Strings that tells us how many days, weeks, months we have left if we live until 90 years old. + +It will take your current age as the input and output a message with our time left in this format: + +You have x days, y weeks, and z months left. + +Where x, y and z are replaced with the actual calculated numbers. +''' + # 🚨 Don't change the code below 👇 age = input("What is your current age?") # 🚨 Don't change the code above 👆 @@ -15,14 +25,10 @@ # Write your code below this line 👇 try: - age = int(age) - years_left = 90 - age - months_left = years_left * 12 - weeks_left = years_left * 52 - days_left = years_left * 365 - - print( - f"You have {years_left} years, {months_left} months, {weeks_left} weeks and {days_left} days left.") - + a = 90-int(age) + x = a*365 + y = a*52 + z = a*12 + print("You have", x,"days", y,"weeks", "and",z ,"months left") except ValueError: - print("Enter age in integer only.") + print("please enter age value in Integer") From ea6e9a80b620d692551abed89284773549109662 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Fri, 1 Aug 2025 20:54:03 +0530 Subject: [PATCH 10/35] main.py --- Day 2/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Day 2/main.py b/Day 2/main.py index 2704622..73a7832 100644 --- a/Day 2/main.py +++ b/Day 2/main.py @@ -1,4 +1,3 @@ mystery = 734_529.678 print(type(mystery)) - -print(6+4/2-(1*2)) \ No newline at end of file +print(6+4/2-(1*2)) From 4e32616a23ff6b03c191f6d4145b42d761014a92 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Fri, 1 Aug 2025 21:03:00 +0530 Subject: [PATCH 11/35] tip_calculator.py --- Day 2/tip_calculator.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Day 2/tip_calculator.py b/Day 2/tip_calculator.py index c88f913..f745c67 100644 --- a/Day 2/tip_calculator.py +++ b/Day 2/tip_calculator.py @@ -7,8 +7,7 @@ tip_rate = input( "What percent of bill do you wish to pay as tip : 10, 12 or 15 ? ") try: - amount = (float(bill)/int(persons)) * ((100+int(tip_rate))/100) - print(f"You need to pay ${round(amount,2)} per person.") - + share = ((float(bill)/int(persons))*(1+(float(tip_rate)/100))) + print("Each person should pay",round((share),2)) except ValueError: - print("Please enter float or integer values only.") + print("please enter the value in correct format") From 32f1a5243ca438385a8af83511c09fe19bf86c6b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Mon, 4 Aug 2025 17:39:20 +0530 Subject: [PATCH 12/35] exercise1.py --- Day 3/exercise1.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Day 3/exercise1.py b/Day 3/exercise1.py index 30f1445..7b74967 100644 --- a/Day 3/exercise1.py +++ b/Day 3/exercise1.py @@ -2,4 +2,11 @@ Write a program that works out whether if a given number is an odd or even number. ''' -print("Even") if int(input()) % 2 == 0 else print("Odd") +try: + sum = int(input("enter the no. to check: ")) + if sum %2 ==0: + print(f"the no.{sum} is even") + else : + print(f"the no.{sum} is Odd") +except ValueError: + print("please enter integer value only") From 299decea0978ea33566f3b1590cd7591849fc035 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Mon, 4 Aug 2025 18:01:59 +0530 Subject: [PATCH 13/35] exercise2_.py --- Day 3/exercise2.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Day 3/exercise2.py b/Day 3/exercise2.py index 614add8..ee33725 100644 --- a/Day 3/exercise2.py +++ b/Day 3/exercise2.py @@ -14,17 +14,15 @@ weight = input("Enter weight in kgs : ") try: - bmi = round(float(weight)/(float(height)**2)) - - if bmi < 18.5: - print(f"Your BMI is {bmi} and you are underweight.") - elif bmi < 25: - print(f"Your BMI is {bmi} and you are normal.") - elif bmi < 30: - print(f"Your BMI is {bmi} and you are slightly overweight.") - elif bmi < 35: - print(f"Your BMI is {bmi} and you are obese.") - else: - print(f"Your BMI is {bmi} and you are clinically obese.") + BMI = float(float(weight)/(float(height)*float(height))) + print(BMI) + if BMI< 18.5: + print("you are underweight") + elif BMI<25: + print("you are Normalweight") + elif BMI <30: + print("you are Obese") + else : + print("you are clinically Obese") except ValueError: - print("Enter integer or float values only.") + print("please enter only float values") From d9b03bb269d064e164a6c14bac018a0cfc787aca Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Mon, 4 Aug 2025 18:30:05 +0530 Subject: [PATCH 14/35] Update exercise3.py --- Day 3/exercise3.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Day 3/exercise3.py b/Day 3/exercise3.py index cfbf2f9..12a0207 100644 --- a/Day 3/exercise3.py +++ b/Day 3/exercise3.py @@ -7,18 +7,19 @@ ''' try: - year = int(input("Enter year : ")) - + year = int(input("Please enter the year: ")) + if year % 4 == 0: if year % 100 == 0: if year % 400 == 0: - print("Leap Year !") + print(f"The year {year} is a Leap Year") else: - print("Not a leap year !") + print(f"The year {year} is NOT a Leap Year") else: - print("Leap Year !") + print(f"The year {year} is a Leap Year") else: - print("Not a leap year !") - + print(f"The year {year} is NOT a Leap Year") + except ValueError: - print("Enter integer values only.") + print("Please enter the year in integer format only.") + From ce736396228f25bf22311621607237ba55a026d9 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Mon, 4 Aug 2025 18:43:21 +0530 Subject: [PATCH 15/35] Update exercise4.py --- Day 3/exercise4.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Day 3/exercise4.py b/Day 3/exercise4.py index fa6ef2e..03d95b9 100644 --- a/Day 3/exercise4.py +++ b/Day 3/exercise4.py @@ -11,26 +11,33 @@ Extra cheese for any size pizza: + $1 ''' -size = input("Which size of pizza ? S, M or L : ") -pepperoni = input("Do you want pepperoni? Y or N : ") -cheese = input("Do you want extra cheese ? Y or N : ") +size = input("Choose your pizza size (S/M/L): ").upper() +add_pepperoni = input("Do you want pepperoni? (Y/N): ").upper() +extra_cheese = input("Do you want extra cheese? (Y/N): ").upper() bill = 0 -if size == 'S': +# Base price +if size == "S": bill += 15 -elif size == 'M': +elif size == "M": bill += 20 -else: +elif size == "L": bill += 25 +else: + print("Invalid pizza size entered!") + exit() -if pepperoni == 'Y': - if size == 'S': +# Pepperoni +if add_pepperoni == "Y": + if size == "S": bill += 2 else: bill += 3 -if cheese == 'Y': +# Extra cheese +if extra_cheese == "Y": bill += 1 -print(f"Your total bill is {bill}.") +print(f"Your final bill is: ${bill}") + From 7afd7c3905690be18b13eabed485a3f6c58ea765 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Tue, 5 Aug 2025 16:26:22 +0530 Subject: [PATCH 16/35] Update exercise5.py --- Day 3/exercise5.py | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Day 3/exercise5.py b/Day 3/exercise5.py index cf3b96f..d533473 100644 --- a/Day 3/exercise5.py +++ b/Day 3/exercise5.py @@ -14,26 +14,22 @@ # Write your code below this line 👇 -name_string = (name1+name2).lower() +combined = (name1 + name2).lower() -t = name_string.count("t") -r = name_string.count("r") -u = name_string.count("u") -e = name_string.count("e") +# Count TRUE letters +t = combined.count("t") +r = combined.count("r") +u = combined.count("u") +e1 = combined.count("e") +true = t + r + u + e1 -l = name_string.count("l") -o = name_string.count("o") -v = name_string.count("v") -e = name_string.count("e") +# Count LOVE letters +l = combined.count("l") +o = combined.count("o") +v = combined.count("v") +e2 = combined.count("e") +love = l + o + v + e2 -true = t+r+u+e -love = l+o+v+e +score = int(str(true) + str(love)) -true_love = int(str(true)+str(love)) - -if true_love < 10 or true_love > 90: - print(f"Your score is {true_love}") -elif 40 <= true_love <= 50: - print(f"Your score is {true_love}, you are alright together.") -else: - print(f"Your score is {true_love}") +print(f"Your love score is {score}") From 2fb9681257ea6736280b423c0ddedce2f363754f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Tue, 5 Aug 2025 16:46:03 +0530 Subject: [PATCH 17/35] Update main.py --- Day 3/main.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Day 3/main.py b/Day 3/main.py index 3f4779e..fe674a5 100644 --- a/Day 3/main.py +++ b/Day 3/main.py @@ -11,22 +11,25 @@ - photo : + $3 ''' +print("Welcome to the Rollercoaster Ride!") + height = int(input("What is your height in cms? : ")) +age = int(input("Please enter your age in years: ")) +photo = input("Do you want framed picture of your ride (Y/N): ").upper() + +price = 0 if height >= 120: - bill = 0 - age = int(input("How old are you ? : ")) - if age <= 12: - bill += 5 + if age < 12: + price += 5 elif age < 18: - bill += 7 + price += 7 else: - bill += 12 + price += 12 - photo = input("Do you want photo? : ") if photo == "Y": - bill += 3 + price += 3 - print(f"Your total bill is {bill}.") + print(f"Total price for your ride is ${price}") else: - print("You are not eligible for the rollercoaster ride.") + print("Sorry! You must be at least 120 cm tall to ride.") From 38aa0c512008cd9bc03f500a6c9a2d6194347dd0 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Tue, 5 Aug 2025 17:07:59 +0530 Subject: [PATCH 18/35] Update treasure_island.py --- Day 3/treasure_island.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Day 3/treasure_island.py b/Day 3/treasure_island.py index 7d8687f..01f80bd 100644 --- a/Day 3/treasure_island.py +++ b/Day 3/treasure_island.py @@ -41,4 +41,4 @@ else: print("You get attacked by an angry trout. Game Over.") else: - print("You fell into a hole. Game Over.") + print("You fell into a deadly hole. Game Over.") From f98c74042740e09521d05cbc3933f4e42deb0423 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Tue, 5 Aug 2025 17:22:33 +0530 Subject: [PATCH 19/35] Update exercise1.py --- Day 4/exercise1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Day 4/exercise1.py b/Day 4/exercise1.py index be6c6c3..c9550e3 100644 --- a/Day 4/exercise1.py +++ b/Day 4/exercise1.py @@ -13,8 +13,8 @@ # 🚨 Don't change the code above 👆 # Write your code below this line 👇 -randomSide = random.randint(0, 1) -if randomSide == 1: +toss = random.randint(0,1) +if toss == 1: print("Heads") else: print("Tails") From 0d58a701fc88b9301e6c4470e7df39f4f8aa1506 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Tue, 5 Aug 2025 17:37:15 +0530 Subject: [PATCH 20/35] Update exercise2.py --- Day 4/exercise2.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Day 4/exercise2.py b/Day 4/exercise2.py index 3f104be..033139f 100644 --- a/Day 4/exercise2.py +++ b/Day 4/exercise2.py @@ -3,20 +3,17 @@ ''' import random + # 🚨 Don't change the code below 👇 test_seed = int(input("Create a seed number: ")) random.seed(test_seed) # Split string method -namesAsCSV = input("Give me everybody's names, seperated by a comma. ") -names = namesAsCSV.split(", ") +namesAsCSV = input("Give me everybody's names, separated by a comma: ") +names = namesAsCSV.split(",") # 🚨 Don't change the code above 👆 # Write your code below this line 👇 -num_items = len(names) -# Generate random numbers between 0 and the last index. -random_choice = random.randint(0, num_items - 1) -# Pick out random person from list of names using the random number. -person_who_will_pay = names[random_choice] +payer = random.choice(names) -print(person_who_will_pay + " is going to buy the meal today!") +print(f"{payer} is going to buy the meal today!️") From 20922c7d52d320fa89ea70200651654b29e9538e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Tue, 5 Aug 2025 19:31:49 +0530 Subject: [PATCH 21/35] Update exercise3.py --- Day 4/exercise3.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Day 4/exercise3.py b/Day 4/exercise3.py index e269098..96082b0 100644 --- a/Day 4/exercise3.py +++ b/Day 4/exercise3.py @@ -12,20 +12,18 @@ row1 = ["⬜️", "⬜️", "⬜️"] row2 = ["⬜️", "⬜️", "⬜️"] row3 = ["⬜️", "⬜️", "⬜️"] -map = [row1, row2, row3] +treasure_map = [row1, row2, row3] print(f"{row1}\n{row2}\n{row3}") -position = input("Where do you want to put the treasure? ") +position = input("Where do you want to put the treasure? ") # e.g. "23" # 🚨 Don't change the code above 👆 -# Write your code below this row 👇 -horizontal = int(position[0]) -vertical = int(position[1]) - -map[vertical - 1][horizontal - 1] = "X" -print(f"{row1}\n{row2}\n{row3}") +# ✅ Write your code below this row 👇 +column = int(position[0]) # 1st digit → column +row = int(position[1]) # 2nd digit → row +# Since Python uses 0-based indexing +selected_row = treasure_map[row - 1] +selected_row[column - 1] = "❌" -# Write your code above this row 👆 - -# 🚨 Don't change the code below 👇 +# ✅ Final map display print(f"{row1}\n{row2}\n{row3}") From f0c4d9c5d23fe8fd10d6dd6278936680d09b4e59 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Tue, 5 Aug 2025 19:56:08 +0530 Subject: [PATCH 22/35] Update game.py --- Day 4/game.py | 80 ++++++++++++++++++--------------------------------- 1 file changed, 28 insertions(+), 52 deletions(-) diff --git a/Day 4/game.py b/Day 4/game.py index fb2c037..67008e3 100644 --- a/Day 4/game.py +++ b/Day 4/game.py @@ -1,54 +1,30 @@ -''' -Rock Paper Scissor -''' +# ROCK PAPER SCISSOR game import random -rock = ''' - _______ ----' ____) - (_____) - (_____) - (____) ----.__(___) -''' - -paper = ''' - _______ ----' ____)____ - ______) - _______) - _______) ----.__________) -''' - -scissors = ''' - _______ ----' ____)____ - ______) - __________) - (____) ----.__(___) -''' - -game_images = [rock, paper, scissors] - -user_choice = int( - input("What do you choose? Type 0 for Rock, 1 for Paper or 2 for Scissors.\n")) -print(game_images[user_choice]) - -computer_choice = random.randint(0, 2) -print("Computer chose:") -print(game_images[computer_choice]) - -if user_choice >= 3 or user_choice < 0: - print("You typed an invalid number, you lose!") -elif user_choice == 0 and computer_choice == 2: - print("You win!") -elif computer_choice == 0 and user_choice == 2: - print("You lose") -elif computer_choice > user_choice: - print("You lose") -elif user_choice > computer_choice: - print("You win!") -elif computer_choice == user_choice: - print("It's a draw") +list = ["Rock","Paper","Scissors"] +user = int(input("Choose your turn (0, 1, 2 for rock, paper, scissor respectively): ")) +print(f"you chose {list[user]}") +com_choice = random.randint(0,2) +print(f"the computer chose {list[com_choice]}") +if user == 0: + if com_choice == 0: + print("Draw") + elif com_choice ==1: + print("you lost") + else: + print("you won") +elif user == 1: + if com_choice == 1: + print("Draw") + elif com_choice ==2: + print("you lost") + else: + print("you won") + +else: + if com_choice == 2: + print("Draw") + elif com_choice ==0: + print("you lost") + else: + print("you won") From 73c63e20aafa4cfba4a4ae30bc0c03a2e16dfe8a Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Wed, 6 Aug 2025 12:09:51 +0530 Subject: [PATCH 23/35] Update exercise1.py --- Day 5/exercise1.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Day 5/exercise1.py b/Day 5/exercise1.py index 1ce8fa1..e384af5 100644 --- a/Day 5/exercise1.py +++ b/Day 5/exercise1.py @@ -1,4 +1,5 @@ ''' +EXERCISE 1: You are going to write a program that calculates the average student height from a List of heights. e.g. student_heights = [180, 124, 165, 173, 189, 169, 146] @@ -14,10 +15,9 @@ # Write your code below this row 👇 - -total_height = 0 - -for height in student_heights: - total_height += height - -print(f"Average height of students is {round(total_height/len(student_heights))}") +summ = 0 +t_num = len(student_heights) +for n in range(0, t_num): + summ += int(student_heights[n]) +avg_height = round(summ/t_num, 2) +print(f"avg height is {avg_height}") From 87a4c6365d8f870cd93cfecb791533f6b8614378 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Wed, 6 Aug 2025 12:45:01 +0530 Subject: [PATCH 24/35] Update exercise1.py i made the code shorter --- Day 5/exercise1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Day 5/exercise1.py b/Day 5/exercise1.py index e384af5..32d1512 100644 --- a/Day 5/exercise1.py +++ b/Day 5/exercise1.py @@ -11,7 +11,7 @@ student_heights = input("Input a list of student heights ").split() for n in range(0, len(student_heights)): student_heights[n] = int(student_heights[n]) -# 🚨 Don't change the code above 👆 +# 🚨 Don't change the code above👆 # Write your code below this row 👇 From 6b4537853b42da03c9a4112d3a8dbbb4814c987a Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Wed, 6 Aug 2025 15:27:28 +0530 Subject: [PATCH 25/35] Update exercise2.py i used value based loop approach --- Day 5/exercise2.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Day 5/exercise2.py b/Day 5/exercise2.py index e5f0e68..4bc2d20 100644 --- a/Day 5/exercise2.py +++ b/Day 5/exercise2.py @@ -9,18 +9,13 @@ ''' # 🚨 Don't change the code below 👇 -student_scores = input("Input a list of student scores ").split() +student_scores = input("Input a list of student scores: ").split() for n in range(0, len(student_scores)): student_scores[n] = int(student_scores[n]) -print(student_scores) -# 🚨 Don't change the code above 👆 - -# Write your code below this row 👇 - -max_score = 0 +highest = 0 for score in student_scores: - if score > max_score: - max_score = score + if score > highest: + highest = score -print(f"The highest score in the class is: {max_score}") +print(f"The highest score in the class is: {highest}") From cc5906cd195825994ccf095cb6e92222564e08f8 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Wed, 6 Aug 2025 15:39:53 +0530 Subject: [PATCH 26/35] Update exercise3.py i used formula --- Day 5/exercise3.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Day 5/exercise3.py b/Day 5/exercise3.py index 7adfcb5..4b9b927 100644 --- a/Day 5/exercise3.py +++ b/Day 5/exercise3.py @@ -1,17 +1,14 @@ ''' -You are going to write a program that calculates the sum of all the even numbers from 1 to 100, including 1 and 100. +You are going to write a program that calculates the sum of all the even numbers from 1 to 100, +including 1 and 100. e.g. 2 + 4 + 6 + 8 +10 ... + 98 + 100 -Important, there should only be 1 print statement in your console output. It should just print the final total and not every step of the calculation. +Important, there should only be 1 print statement in your console output. +It should just print the final total and not every step of the calculation. ''' #Write your code below this row 👇 - -total = 0 - -for num in range(1,101): - if num % 2 == 0: - total += num - -print(total) \ No newline at end of file +n =100/2 +Sum = int(n*(n+1)) +print(f"the sum of all the even nos. from 1 to 100: {Sum}") From c774ce237216277dd0e5899cf0851bb94b7afac9 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Wed, 6 Aug 2025 15:59:24 +0530 Subject: [PATCH 27/35] Update exercise4.py I used nested if function inside for loop --- Day 5/exercise4.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Day 5/exercise4.py b/Day 5/exercise4.py index b543384..4f88e42 100644 --- a/Day 5/exercise4.py +++ b/Day 5/exercise4.py @@ -11,13 +11,14 @@ ''' # Write your code below this row 👇 - -for num in range(1, 101): - if num % 3 == 0 and num % 5 == 0: - print("FizzBuzz") - elif num % 3 == 0 and num % 5 != 0: - print("Fizz") - elif num % 3 != 0 and num % 5 == 0: - print("Buzz") +for num in range(1,101): + if num % 3 == 0: + if num % 5 ==0: + print("FizzBuzz") + else: + print("Fizz") else: - print(num) + if num % 5 ==0: + print("Buzz") + else: + print(num) From 9a6d8c96f7d408c1f15e159767e878c593201010 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Wed, 6 Aug 2025 18:36:34 +0530 Subject: [PATCH 28/35] Update password_generator.py the output format is in string without gap --- Day 5/password_generator.py | 55 ++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/Day 5/password_generator.py b/Day 5/password_generator.py index 7946875..513aa4e 100644 --- a/Day 5/password_generator.py +++ b/Day 5/password_generator.py @@ -10,38 +10,31 @@ nr_symbols = int(input(f"How many symbols would you like?\n")) nr_numbers = int(input(f"How many numbers would you like?\n")) -# Eazy Level - Order not randomised: -# e.g. 4 letter, 2 symbol, 2 number = JduE&!91 -password = "" -for char in range(1, nr_letters + 1): - password += random.choice(letters) -for char in range(1, nr_symbols + 1): - password += random.choice(symbols) +#Easy level (Non randomised order) +password = [] -for char in range(1, nr_numbers + 1): +for char in range(1,nr_letters + 1): + password += random.choice(letters) +for char in range(1, nr_symbols+1): + password += random.choice(symbols) +for char in range(1,nr_numbers): password += random.choice(numbers) - -print(f"Your easy password is {password}") - -# Hard Level - Order of characters randomised: -# e.g. 4 letter, 2 symbol, 2 number = g^2jk8&P -password_list = [] - -for char in range(1, nr_letters + 1): - password_list.append(random.choice(letters)) - -for char in range(1, nr_symbols + 1): - password_list += random.choice(symbols) - -for char in range(1, nr_numbers + 1): - password_list += random.choice(numbers) - -random.shuffle(password_list) - -password = "" -for char in password_list: - password += char - -print(f"Your hard password is: {password}") +password = ''.join(password) +print(f"Easy password is: {password}") + +#Tough level (Randomised Order) +Tpassword = [] + +for char in range(1,nr_letters + 1): + Tpassword.append(random.choice(letters)) +for char in range(1, nr_symbols+1): + Tpassword.append(random.choice(symbols)) +for char in range(1,nr_numbers): + Tpassword.append(random.choice(numbers)) + +random.shuffle(Tpassword) +Tpassword = ''.join(Tpassword) + +print(f"Hard password is: {Tpassword}") From 2577d6116b4ba8f5ee5e24f474bc9d098c6502ef Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 7 Aug 2025 15:10:52 +0530 Subject: [PATCH 29/35] Update hurdle4.py --- Day 6/hurdle4.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Day 6/hurdle4.py b/Day 6/hurdle4.py index c1865c2..f96829a 100644 --- a/Day 6/hurdle4.py +++ b/Day 6/hurdle4.py @@ -19,7 +19,7 @@ def jump(): turn_left() while not at_goal(): - if front_is_clear(): - move() + if wall_in_front(): + jump() else: - jump() \ No newline at end of file + move() From 4f2fbf6205184d2926ebe69227f6801cbc17911c Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 7 Aug 2025 15:14:32 +0530 Subject: [PATCH 30/35] Update hurdle1.py used if else function --- Day 6/hurdle1.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Day 6/hurdle1.py b/Day 6/hurdle1.py index 8a5b832..5f9ed92 100644 --- a/Day 6/hurdle1.py +++ b/Day 6/hurdle1.py @@ -7,8 +7,7 @@ def turn_right(): turn_left() turn_left() -def complete(): - move() +def jump(): turn_left() move() turn_right() @@ -16,6 +15,9 @@ def complete(): turn_right() move() turn_left() - -for _ in range(6): - complete() \ No newline at end of file + +while not at_goal(): + if wall_in_front(): + jump() + else: + move() From 40cf0d5d040a201bfaaf95848118c0b8bfedfafa Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 7 Aug 2025 15:18:13 +0530 Subject: [PATCH 31/35] Update hurdle2.py --- Day 6/hurdle2.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Day 6/hurdle2.py b/Day 6/hurdle2.py index 5267cf0..1e8a474 100644 --- a/Day 6/hurdle2.py +++ b/Day 6/hurdle2.py @@ -8,8 +8,7 @@ def turn_right(): turn_left() turn_left() -def complete(): - move() +def jump(): turn_left() move() turn_right() @@ -19,4 +18,7 @@ def complete(): turn_left() while not at_goal(): - complete() \ No newline at end of file + if wall_in_front(): + jump() + else: + move() From 71e7da4654df4b93a0a12183c60c7b65e6fb3043 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 7 Aug 2025 15:21:07 +0530 Subject: [PATCH 32/35] Update hurdle3.py --- Day 6/hurdle3.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Day 6/hurdle3.py b/Day 6/hurdle3.py index 33584b1..369b745 100644 --- a/Day 6/hurdle3.py +++ b/Day 6/hurdle3.py @@ -17,7 +17,7 @@ def jump(): turn_left() while not at_goal(): - if front_is_clear(): - move() + if wall_in_front(): + jump() else: - jump() \ No newline at end of file + move() From f2cefff3b4c4312b61eb854dfdd5880c18ce03d4 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 7 Aug 2025 18:14:35 +0530 Subject: [PATCH 33/35] Update maze.py --- Day 6/maze.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Day 6/maze.py b/Day 6/maze.py index 9881f67..edc187e 100644 --- a/Day 6/maze.py +++ b/Day 6/maze.py @@ -14,4 +14,4 @@ def turn_right(): elif front_is_clear(): move() else: - turn_left() \ No newline at end of file + turn_left() From cba7190a986af8cc04c30fcab3667ba35767fc4f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Thu, 7 Aug 2025 18:28:51 +0530 Subject: [PATCH 34/35] Create readme_checklist.md --- readme_checklist.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 readme_checklist.md diff --git a/readme_checklist.md b/readme_checklist.md new file mode 100644 index 0000000..a6137c3 --- /dev/null +++ b/readme_checklist.md @@ -0,0 +1,8 @@ +checklist +day 1: [X] +day 2: [X] +day 3: [X] +day 4: [X] +day 5: [X] +day 6: [X] +day 7: [ ] From 1b63354859bb18b141374181479d3f9c31e01ebf Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Patel Date: Fri, 8 Aug 2025 12:48:59 +0530 Subject: [PATCH 35/35] Update challenge1.py for loop is necessary --- Day 7/challenge1.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Day 7/challenge1.py b/Day 7/challenge1.py index 41463dc..230d81f 100644 --- a/Day 7/challenge1.py +++ b/Day 7/challenge1.py @@ -5,16 +5,15 @@ # TODO-1 - Randomly choose a word from the word_list and assign it to a variable called chosen_word. -chosen_word = random.choice(word_list) +chosen = random.choice(word_list) # TODO-2 - Ask the user to guess a letter and assign their answer to a variable called guess. Make guess lowercase. -guess = input("Guess a letter: ").lower() +guess = input("Guess a letter among the word_list: ").lower() # TODO-3 - Check if the letter the user guessed (guess) is one of the letters in the chosen_word. -for letter in chosen_word: - if guess == letter: - print("Right") - else: - print("Wrong") +if guess == chosen: + print("you guessed Right") +else: + print("you guessed Wrong")