diff --git a/challenges/01-calc.py b/challenges/01-calc.py index 87f5190..dab592c 100644 --- a/challenges/01-calc.py +++ b/challenges/01-calc.py @@ -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()) + \ No newline at end of file diff --git a/challenges/02-reverse.py b/challenges/02-reverse.py index 8cf2677..8abecd1 100644 --- a/challenges/02-reverse.py +++ b/challenges/02-reverse.py @@ -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) \ No newline at end of file diff --git a/challenges/03-bank.py b/challenges/03-bank.py index 554cb1d..564f2fe 100644 --- a/challenges/03-bank.py +++ b/challenges/03-bank.py @@ -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!") diff --git a/challenges/04-alphabetical.py b/challenges/04-alphabetical.py index 5051ec4..f9e3f00 100644 --- a/challenges/04-alphabetical.py +++ b/challenges/04-alphabetical.py @@ -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)