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
45 changes: 45 additions & 0 deletions challenges/01-calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,48 @@
# input() always returns a string value. If you ever want someone
# to enter a number you have to use the `int()` function to convert
# what they typed in to a string.

# prompt = input('What operation would you like to perform?(add, multiply, subtract, divide)')
# num1 = input('what is the 1st number you want to use?')
# num1 = int(num1)
# num2 = input('what is the 2nd number you want to use?')
# num2 = int(num2)

# def calculate():
# if prompt == "add":
# return num1 + num2
# elif prompt == "subtract":
# return num1 - num2
# elif prompt == "multiply":
# return num1 * num2
# elif prompt == "divide":
# return num1 / num2
# print(f"your result is {calculate()} bitch")

# name = input("What's your name? ")
# count = input("How many times shall I greet you? ")
# count = int(count)

# for i in range(count):
# print(f"Hello {name}!")

start = input("Anthony has a couple...literally two questions for you? type ok to continue if you dare.")
prompt = input("Do you love anthony unconditionally?")
prompt2 = input('Even if he farted in your face?')
marry = 'then marry me already'


def answer():
if prompt == "yes" and prompt2 == "yes":
return "Anthony is happy! Will you marry him?"
elif prompt == "no" and prompt2 == "no":
return "Anthony wants you to leave...now"
elif prompt == "yes" and prompt2 == "no":
return "well its too fucking late"
elif prompt == "no" and prompt2 == "yes":
return "He thinks your, your wierd. but low key he wants to know what he can do to get you to love him unconditional."



print(answer())

8 changes: 8 additions & 0 deletions challenges/02-reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
# several ways to reverse a string, and it's a good read!
#
# http://www.techbeamers.com/essential-python-tips-tricks-programmers/?utm_source=mybridge&utm_medium=blog&utm_campaign=read_more#tip1

string = 'heaven'
reversed_string = ''

for i in reversed(string):
reversed_string += i

print(reversed_string)
38 changes: 38 additions & 0 deletions challenges/03-bank.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
print("Welcome to Chase bank.")

options = input("Would you like to withdraw, deposit, or check_balance? \n")
balance = 2300
balance = int(balance)
num1 = input("how much would you like to deposit?\n")
num1 = int(num1)
num2 = input("how much would you like to withdraw?\n")
num2 = int(num2)
response = input("would you like to display your balance?")




def banking():
if options == "check_balance":
return balance
if options == "deposit":
response
if response == "yes":
return f"Thanks for banking with us your balance is {balance + num1}"
elif response == "no":
return "thanks for banking with us"
if options == "withdraw":
response
if response == "yes":
return f"Thanks for banking with us your balance is {balance - num2}"
if response == "no":
return "thank you"







print(banking())


print("Have a nice day!")

4 changes: 4 additions & 0 deletions challenges/04-alphabetical.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# You'll need to use a couple of built in functions to alphabetize a string.
# Try to avoid looking up the exact answer and look at built in functions for
# lists and strings instead.
phrase = 'i love beging healthy'
sorted_phrase = ''.join(sorted(phrase))

print(sorted_phrase)