Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
57be73a
band-generator.py
abhixpatel Jul 31, 2025
39b8160
exercise1.py
abhixpatel Jul 31, 2025
09251b4
exercise2.py
abhixpatel Jul 31, 2025
d1185ca
exercise3.py
abhixpatel Jul 31, 2025
00640a2
exercise4.py
abhixpatel Jul 31, 2025
ceb5676
main.py
abhixpatel Jul 31, 2025
aa62cac
exercise1.py
abhixpatel Aug 1, 2025
cf30f83
exercise2.py
abhixpatel Aug 1, 2025
a7bc441
exercise3.py
abhixpatel Aug 1, 2025
ea6e9a8
main.py
abhixpatel Aug 1, 2025
4e32616
tip_calculator.py
abhixpatel Aug 1, 2025
32f1a52
exercise1.py
abhixpatel Aug 4, 2025
299dece
exercise2_.py
abhixpatel Aug 4, 2025
d9b03bb
Update exercise3.py
abhixpatel Aug 4, 2025
ce73639
Update exercise4.py
abhixpatel Aug 4, 2025
7afd7c3
Update exercise5.py
abhixpatel Aug 5, 2025
2fb9681
Update main.py
abhixpatel Aug 5, 2025
38aa0c5
Update treasure_island.py
abhixpatel Aug 5, 2025
f98c740
Update exercise1.py
abhixpatel Aug 5, 2025
0d58a70
Update exercise2.py
abhixpatel Aug 5, 2025
20922c7
Update exercise3.py
abhixpatel Aug 5, 2025
f0c4d9c
Update game.py
abhixpatel Aug 5, 2025
73c63e2
Update exercise1.py
abhixpatel Aug 6, 2025
87a4c63
Update exercise1.py
abhixpatel Aug 6, 2025
6b45378
Update exercise2.py
abhixpatel Aug 6, 2025
cc5906c
Update exercise3.py
abhixpatel Aug 6, 2025
c774ce2
Update exercise4.py
abhixpatel Aug 6, 2025
9a6d8c9
Update password_generator.py
abhixpatel Aug 6, 2025
2577d61
Update hurdle4.py
abhixpatel Aug 7, 2025
4f2fbf6
Update hurdle1.py
abhixpatel Aug 7, 2025
40cf0d5
Update hurdle2.py
abhixpatel Aug 7, 2025
71e7da4
Update hurdle3.py
abhixpatel Aug 7, 2025
f2cefff
Update maze.py
abhixpatel Aug 7, 2025
cba7190
Create readme_checklist.md
abhixpatel Aug 7, 2025
1b63354
Update challenge1.py
abhixpatel Aug 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Day 1/band-generator.py
Original file line number Diff line number Diff line change
@@ -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}.")
print(f"Your band name should be {band_name}.")
3 changes: 1 addition & 2 deletions Day 1/exercise1.py
Original file line number Diff line number Diff line change
@@ -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 ' '.")
4 changes: 2 additions & 2 deletions Day 1/exercise2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")')
Expand Down Expand Up @@ -68,4 +68,4 @@ def test_1(self):
print(".\n.\n.")
unittest.main(verbosity=1, exit=False)

os.remove("testing_copy.py")
os.remove("testing_copy.py")
2 changes: 1 addition & 1 deletion Day 1/exercise3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
'''

string = input("Enter the string : ")
print(len(string))
print(len(string))
6 changes: 3 additions & 3 deletions Day 1/exercise4.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion Day 1/main.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
print("Hello World !")
print("Hello World!")
2 changes: 1 addition & 1 deletion Day 2/exercise1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
10 changes: 7 additions & 3 deletions Day 2/exercise2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
26 changes: 16 additions & 10 deletions Day 2/exercise3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@
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 👆

# 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")
3 changes: 1 addition & 2 deletions Day 2/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mystery = 734_529.678
print(type(mystery))

print(6+4/2-(1*2))
print(6+4/2-(1*2))
7 changes: 3 additions & 4 deletions Day 2/tip_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
9 changes: 8 additions & 1 deletion Day 3/exercise1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
24 changes: 11 additions & 13 deletions Day 3/exercise2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
17 changes: 9 additions & 8 deletions Day 3/exercise3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

27 changes: 17 additions & 10 deletions Day 3/exercise4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

34 changes: 15 additions & 19 deletions Day 3/exercise5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
23 changes: 13 additions & 10 deletions Day 3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
2 changes: 1 addition & 1 deletion Day 3/treasure_island.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
4 changes: 2 additions & 2 deletions Day 4/exercise1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
13 changes: 5 additions & 8 deletions Day 4/exercise2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Loading