Skip to content

Commit b6cb9d1

Browse files
authored
created
1 parent 12dbb83 commit b6cb9d1

File tree

11 files changed

+294
-0
lines changed

11 files changed

+294
-0
lines changed

BMI Calculator/main.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# 🚨 Don't change the code below 👇
2+
height = float(input("enter your height in m: "))
3+
weight = float(input("enter your weight in kg: "))
4+
# 🚨 Don't change the code above 👆
5+
6+
#Write your code below this line 👇
7+
8+
x=float(height)
9+
y=float(weight)
10+
bmi =y / (x ** 2)
11+
print(height,"/","(",weight,"x",weight,")","=", bmi)
12+
z=round(bmi)
13+
14+
15+
if z<18.5:
16+
print(f"Your BMI is {z}, you are underweight.")
17+
elif z<25:
18+
print(f"Your BMI is {z}, you have a normal weight.")
19+
elif z<30:
20+
print(f"Your BMI is {z}, you are overweight.")
21+
elif z<35:
22+
print("Your BMI is {z}, you are obese.")
23+
else:
24+
print("Your BMI is {z}, you are clinically obese.")

Game-Rock, Paper, Scissors/main.py

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import random
2+
3+
rock = '''
4+
_______
5+
---' ____)
6+
(_____)
7+
(_____)
8+
(____)
9+
---.__(___)
10+
'''
11+
12+
paper = '''
13+
_______
14+
---' ____)____
15+
______)
16+
_______)
17+
_______)
18+
---.__________)
19+
'''
20+
21+
scissors = '''
22+
_______
23+
---' ____)____
24+
______)
25+
__________)
26+
(____)
27+
---.__(___)
28+
'''
29+
game_images = [rock, paper, scissors]
30+
31+
user_choice = int(input("What do you choose? Type 0 for Rock, 1 for Paper or 2 for Scissors.\n"))
32+
if user_choice >= 3 or user_choice < 0:
33+
print("You typed an invalid number, you lose!")
34+
else:
35+
print(game_images[user_choice])
36+
37+
computer_choice = random.randint(0, 2)
38+
print("Computer chose:")
39+
print(game_images[computer_choice])
40+
41+
if user_choice == 0 and computer_choice == 2:
42+
print("You win!")
43+
elif computer_choice == 0 and user_choice == 2:
44+
print("You lose")
45+
elif computer_choice > user_choice:
46+
print("You lose")
47+
elif user_choice > computer_choice:
48+
print("You win!")
49+
elif computer_choice == user_choice:
50+
print("It's a draw")

Heads or Teals/main.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#Write your code below this line 👇
2+
#Hint: Remember to import the random module first. 🎲
3+
import random
4+
toss_coin = random.randint(0,1)
5+
if toss_coin == 1:
6+
print("Heads")
7+
else :print("Teals")
8+

Life Expectancy Calculator/main.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 🚨 Don't change the code below 👇
2+
age = input("What is your current age?")
3+
# 🚨 Don't change the code above 👆
4+
5+
#Write your code below this line 👇
6+
7+
new_age = 90 - int(age)
8+
days = new_age * 365
9+
weeks = new_age * 52
10+
months = new_age * 12
11+
print(f"You have {days} days, {weeks} weeks, and {months} months left.")
12+
13+
14+
15+

Love Calculator/main.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 🚨 Don't change the code below 👇
2+
print("Welcome to the Love Calculator!")
3+
name1 = input("What is your name? \n")
4+
name2 = input("What is their name? \n")
5+
# 🚨 Don't change the code above 👆
6+
7+
#Write your code below this line 👇
8+
digit1 = name1.lower().count("t") + name1.lower().count("r") + name1.lower().count("u") + name1.lower().count("e") + name2.lower().count("t") + name2.lower().count("r") + name2.lower().count("u") + name2.lower().count("e")
9+
10+
digit2 = name1.lower().count("l") + name1.lower().count("o") + name1.lower().count("v") + name1.lower().count("e") + name2.lower().count("l") + name2.lower().count("o") + name2.lower().count("v") + name2.lower().count("e")
11+
12+
love_score = int(str(digit1) + str(digit2))
13+
14+
if love_score < 10 or love_score > 90:
15+
print(f"Your score is {love_score}, you go together like coke and mentos.")
16+
elif love_score >= 40 and love_score <= 50:
17+
print(f"Your score is {love_score}, you are alright together.")
18+
else:
19+
print(f"Your score is {love_score}")

Password Generator Project/pass.py

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
#Password Generator Project
3+
import random
4+
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
5+
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
6+
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
7+
8+
print("Welcome to the PyPassword Generator!")
9+
nr_letters= int(input("How many letters would you like in your password?\n"))
10+
nr_symbols = int(input(f"How many symbols would you like?\n"))
11+
nr_numbers = int(input(f"How many numbers would you like?\n"))
12+
13+
#Eazy Level - Order not randomised:
14+
#e.g. 4 letter, 2 symbol, 2 number = JduE&!91
15+
# password=""
16+
# for char in range(1, nr_letters+1):
17+
# password+=random.choice(letters)
18+
# for char in range(1,nr_symbols+1):
19+
# password+=random.choice(symbols)
20+
# for char in range(1,nr_numbers+1):
21+
# password+=random.choice(numbers)
22+
# print(password)
23+
#Hard Level - Order of characters randomised:
24+
#e.g. 4 letter, 2 symbol, 2 number = g^2jk8&P
25+
26+
password_complex=[]
27+
for char in range(1, nr_letters+1):
28+
password_complex+=random.choice(letters)
29+
for char in range(1,nr_symbols+1):
30+
password_complex+=random.choice(symbols)
31+
for char in range(1,nr_numbers+1):
32+
password_complex+=random.choice(numbers)
33+
print(password_complex)
34+
random.shuffle(password_complex)
35+
string_pass_compl="".join(password_complex)
36+
print(string_pass_compl)

Pizza Order Script/main.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# 🚨 Don't change the code below 👇
2+
print("Welcome to Python Pizza Deliveries!")
3+
size = input("What size pizza do you want? S, M, or L : ")
4+
add_pepperoni = input("Do you want pepperoni? Y or N : ")
5+
extra_cheese = input("Do you want extra cheese? Y or N : ")
6+
# 🚨 Don't change the code above 👆
7+
8+
#Write your code below this line 👇
9+
bill = 0
10+
if size == "S":
11+
bill += 100
12+
elif size == "M":
13+
bill += 150
14+
elif size == "L":
15+
bill += 200
16+
17+
if add_pepperoni == "Y":
18+
if size == "S":
19+
bill += 40
20+
elif size == "M":
21+
bill += 70
22+
elif size == "L":
23+
bill += 100
24+
25+
if extra_cheese == "Y":
26+
bill += 25
27+
else:
28+
bill +=0
29+
30+
print(f"Your final bill is ₹{bill}")

Reminder App/main.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
# make sure you entered this command in terminal before using [pip install plyer]
3+
# you can also customize my project as per you need. For eg-you can modify as a daily word vocab reminder app
4+
5+
6+
7+
from plyer import notification
8+
import time
9+
10+
def set_reminder(title, message, delay_seconds):
11+
notification.notify(
12+
title=title,
13+
message=message,
14+
app_name='Reminder App',
15+
timeout=10
16+
)
17+
time.sleep(delay_seconds)
18+
19+
if __name__ == "__main__":
20+
while True:
21+
title = input("Enter the reminder title: ")
22+
message = input("Enter the reminder message: ")
23+
delay_minutes = int(input("Enter the delay in minutes: "))
24+
25+
delay_seconds = delay_minutes * 60
26+
27+
set_reminder(title, message, delay_seconds)

Tip Calculator/main.py

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# #If the bill was $150.00, split between 5 people, with 12% tip.
2+
3+
# #Each person should pay (150.00 / 5) * 1.12 = 33.6
4+
# #Format the result to 2 decimal places = 33.60
5+
6+
# #Tip: There are 2 ways to round a number. You might have to do some Googling to solve this.💪
7+
8+
# #Write your code below this line 👇
9+
10+
# # Get user input for bill amount, number of people, and tip percentage
11+
# bill_amount = float(input("Enter the bill amount: ₹"))
12+
# num_people = int(input("Enter the number of people: "))
13+
# tip_percentage = float(input("Enter the tip percentage: "))
14+
15+
# # Calculate the total amount including tip
16+
# total_amount = bill_amount * (1 + tip_percentage / 100)
17+
18+
# # Calculate the amount each person should pay
19+
# amount_per_person = total_amount / num_people
20+
21+
# # Format the result to two decimal places
22+
# formatted_amount = "{:.2f}".format(amount_per_person)
23+
24+
# # Print the result
25+
# print("Each person should pay ₹" + formatted_amount)
26+
from plyer import notification
27+
import time
28+
29+
def set_reminder(title, message, delay_seconds):
30+
notification.notify(
31+
title=title,
32+
message=message,
33+
app_name='Reminder App',
34+
timeout=10
35+
)
36+
time.sleep(delay_seconds)
37+
38+
if __name__ == "__main__":
39+
while True:
40+
title = input("Enter the reminder title: ")
41+
message = input("Enter the reminder message: ")
42+
delay_minutes = int(input("Enter the delay in minutes: "))
43+
44+
delay_seconds = delay_minutes * 60
45+
46+
set_reminder(title, message, delay_seconds)

Treasure Mapping/main.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 🚨 Don't change the code below 👇
2+
row1 = ["⬜️","⬜️","⬜️"]
3+
row2 = ["⬜️","⬜️","⬜️"]
4+
row3 = ["⬜️","⬜️","⬜️"]
5+
map = [row1, row2, row3]
6+
print(f"{row1}\n{row2}\n{row3}")
7+
position = input("Where do you want to put the treasure? ")
8+
# 🚨 Don't change the code above 👆
9+
10+
#Write your code below this row 👇
11+
12+
13+
h = int(position[0])
14+
v = int(position[1])
15+
16+
if 0 < v <= 3 and 0 < h <= 3:
17+
map[v - 1][h - 1] = 'X'
18+
else:
19+
print("Invalid input. Please enter valid coordinates.")
20+
21+
22+
23+
24+
#Write your code above this row 👆
25+
26+
# 🚨 Don't change the code below 👇
27+
print(f"{row1}\n{row2}\n{row3}")

Who's Paying/main.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import random
2+
# Split string method
3+
names_string = input("Give me everybody's names, separated by a comma. ")
4+
names = names_string.split(", ")
5+
# 🚨 Don't change the code above 👆
6+
7+
#Write your code below this line 👇
8+
9+
random_index = random.randint(0, len(names) - 1)
10+
random_name = names[random_index]
11+
print(f"{random_name} is going to buy the meal today!")
12+

0 commit comments

Comments
 (0)