Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions coin_flip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Write code below 💖
import random

num=random.randint(0,1)

if num>0.5:
print('heads')
else:
print('tails')
7 changes: 7 additions & 0 deletions currency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Write code below 💖
pesos=float(input('What do you have left in pesos?:'))
soles=float(input('What do you have left in soles?:'))
reais=float(input('What do you have left in reais?:'))

USD= (pesos*0.00025)+(soles*0.28)+(reais*0.18)
print(USD)
10 changes: 10 additions & 0 deletions grades.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Write code below 💖

import random

grade=random.randrange(0,100)
print('Grades:' + str(grade))
if grade >= 55:
print('You Passed')
else:
print('You failed')
14 changes: 14 additions & 0 deletions high_school_grades.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Write code below 💖

grade = int(input('Enter your Grades: '))

if grade ==9:
print('Freshman')
elif grade == 10 :
print('Sophomore')
elif grade == 11:
print('Junior')
elif grade == 12:
print('Senior')
else:
print('TBD')
25 changes: 25 additions & 0 deletions magic8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Write code below 💖

import random

q=input('Question:' )
gen=random.randint(1,9)

if gen==1:
print('Magic 8 Ball: Yes - definitely.')
elif gen==2:
print('Magic 8 Ball:It is decidedly so.')
elif gen==3:
print('Magic 8 Ball:Without a doubt')
elif gen==4:
print('Magic 8 Ball:Reply hazy, try again.')
elif gen==5:
print('Magic 8 Ball:Ask again later')
elif gen==6:
print('Magic 8 Ball:Better not tell you now.')
elif gen==7:
print('Magic 8 Ball:My sources say no.')
elif gen==8:
print('Magic 8 Ball:Outlook not so good')
else:
print('Magic 8 ball: Very doubtful.')
11 changes: 11 additions & 0 deletions ph_levels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Write code below 💖
import random

ph=random.randrange(0,14)

if ph > 7:
print('Basic')
elif ph < 7:
print('Acidic')
else:
print('Neutral')
18 changes: 18 additions & 0 deletions random_fact.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Write code below 💖

import random

rand= random.randint(0,5)

if rand==0:
print('Flamingos turn pink from eating shrimp.')
elif rand == 1:
print('The only food that doesn\'t spoil is honey')
elif rand == 2:
print('Shrimp can only swim backwards.')
elif rand == 3:
print('A taste bud\'s life span is about 10 days.')
elif rand == 4:
print('It is impossible to sneeze while sleeping.')
elif rand ==5:
print('It is illegal to sing off-key in North Carolina.')
15 changes: 15 additions & 0 deletions rating.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Write code below 💖

rating=0.0
rating=float(input('Add you ratings: '))

if rating > 4.5:
print("Extraordinary")
elif rating>4:
print('Excellent')
elif rating >3 and rating<=4:
print('Good')
elif rating > 2 and rating<=3:
print('Fair')
else:
print('Poor')
58 changes: 58 additions & 0 deletions sorting_hat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Write code below 💖

Gryffindor=0
Ravenclaw=0
Huffelpuff=0
Slytherin=0

q1=int(input('''Q1) Do you like Dawn or Dusk?
1) Dawn
2) Dusk'''))

if q1 == 1:
Gryffindor = +1
Ravenclaw = +1
elif q1==2:
Huffelpuff=+1
Slytherin=+1
else:
print('Wrong input')

q2= int(input('''Q2) When I’m dead, I want people to remember me as:
1) The Good
2) The Great
3) The Wise
4) The Bold'''))

if q2 == 1:
Huffelpuff= +2
elif q2==2:
Slytherin=+2
elif q2==3:
Ravenclaw=+2
elif q2==4:
Gryffindor=+2
else:
print('Wrong Input')

q3= int(input('''Q3) Which kind of instrument most pleases your ear?
1) The violin
2) The trumpet
3) The piano
4) The drum'''))

if q3 == 1:
Slytherin= +4
elif q3==2:
Huffelpuff=+4
elif q3==3:
Ravenclaw=+4
elif q3==4:
Gryffindor=+4
else:
print('Wrong input')

print('Slytherin Score: ' + str(Slytherin))
print('Huffelpuff Score: ' + str(Huffelpuff))
print('Ravenclaw Score: ' + str(Ravenclaw))
print('Gryffindor Score: ' + str(Gryffindor))
13 changes: 13 additions & 0 deletions the_cyclone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Write code below 💖

height= float(input('Whats your height?'))
credits=float(input('How many credits do you have?'))

if height>137 and credits>10:
print('Enjoy the ride!')
elif credits>10 and height <137:
print('You are not tall enough')
elif height>137 and credits<10:
print('You dont have enough credits')
else:
print('You are not allowed!!')
14 changes: 14 additions & 0 deletions weather.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Write code below 💖

month=int(input('Enter the Month number: '))

if month == 1 or month == 2 or month ==3 :
print('Winter 🌨️')
elif month == 4 or month == 5 or month ==6:
print('Spring 🌱')
elif month == 7 or month == 8 or month ==9:
print('Summer 🌻')
elif month == 10 or month == 11 or month ==12 :
print('Autumn 🍂')
else:
print('Invalid')