-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#challenge | ||
#checking if a number is odd or even | ||
|
||
|
||
print("welcome to the number check where we check if a number is odd or even") | ||
number=int(input("enter your number: ")) | ||
|
||
if number%2==0: | ||
print("the number is even") | ||
else: | ||
print("the number is odd") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#BMI CALCULATOR | ||
|
||
print("welcome to our bmi calculator") | ||
|
||
height=float(input('enter your height in cm: ')) | ||
weight= float(input("enter your weight in kg: ")) | ||
|
||
bmi= round(weight/(height/100)**2) | ||
|
||
print(bmi) | ||
if bmi<18.5: | ||
print("you are under weight") | ||
elif bmi>=18.8 and bmi <25: | ||
print("you have a normal weight") | ||
elif bmi >=25 and bmi<30: | ||
print("you are over weight") | ||
elif bmi>=30 and bmi<35: | ||
print("you are obese") | ||
else: | ||
print("you are clinically obese") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# LEAP YEAR CHALLENGE | ||
|
||
print("welcome again here we check whether the given year is a leap year or not") | ||
|
||
year=int(input("enter your year of choice")) | ||
|
||
if year%4==0: | ||
if year%400==0: | ||
print("this is a leap year") | ||
else: | ||
print("not a leap year") | ||
print(f"so the year {year} is a leap year") | ||
else: | ||
print('not a leap year') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
print('welcome to the rolllercoster') | ||
height=int(input("enter your height in cm: ")) | ||
|
||
if height>=120: | ||
print("you can ride the rollercoster!") | ||
else: | ||
print("sorry you have to grow taller to ride here!") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#multiple if conditions | ||
print("welcome agin to our rolllercoster") | ||
height=int(input("enter your height in cm: ")) | ||
bill=0 | ||
if height>120: | ||
print("you can ride the roller coster") | ||
|
||
age=int(input("enter your age")) | ||
if age>18: | ||
bill=20 | ||
print("adult ticket: $20") | ||
elif age<12: | ||
bill=5 | ||
print("children ticket: $5") | ||
elif age>=12 and age<=18: | ||
bill=7 | ||
print("youth tickets: $7") | ||
|
||
wantphoto=input("do ypu want a photo taken ?: Y or N: ") | ||
if wantphoto.lower()=="y": | ||
bill+=3 | ||
|
||
if wantphoto.lower()=='n': | ||
bill+=0 | ||
print("thank you and enjoy your ride") | ||
print(f"your total bill is {bill}") | ||
|
||
else: | ||
print("you will have to grow taller to ride") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
print("welcome agin to our rolllercoster") | ||
height=int(input("enter your height in cm: ")) | ||
|
||
if height>120: | ||
print("you can ride the roller coster") | ||
|
||
age=int(input("enter your age")) | ||
if age>18: | ||
print("you will have to pay adult price $20") | ||
elif age<12: | ||
print("please pay $5") | ||
elif age>=12 and age<=18: | ||
print("please pay $7") | ||
else: | ||
print("you will have to grow taller to ride") | ||
|