diff --git a/8_Ball_game/8_ball.py b/8_Ball_game/8_ball.py new file mode 100644 index 00000000..5b201bc9 --- /dev/null +++ b/8_Ball_game/8_ball.py @@ -0,0 +1,36 @@ +import random + +# Randomly generated responses for the 8 Ball. +def magic_8_ball(): + responses = [ + "It is certain.", + "It is decidedly so.", + "Without a doubt.", + "Yes definitely.", + "You may rely on it.", + "As I see it, yes.", + "Most likely.", + "Outlook is good.", + "Yes.", + "Signs point to yes.", + "Reply hazy, try again.", + "Ask again later.", + "Better not tell you now.", + "Cannot predict now.", + "Concentrate and ask again.", + "Don't count on it.", + "My reply is no.", + "My sources say no.", + "Outlook is not so good.", + "Very doubtful." + ] + +# Prompt user to input question for 8 Ball response. + while True: + question = input("Ask the Magic 8 Ball a question (type 'exit' to quit): ") + if question.lower() == 'exit': + break + answer = random.choice(responses) + print("Magic 8 Ball says:", answer) + +magic_8_ball() diff --git a/InspireQuotes/InspireQuotes.py b/InspireQuotes/InspireQuotes.py new file mode 100644 index 00000000..923f97bb --- /dev/null +++ b/InspireQuotes/InspireQuotes.py @@ -0,0 +1,28 @@ +# A game that sends you an inspirational quote when you choose a number. + +def inspirational_quote(number): + quotes = { + 1: "Believe you can and you're halfway there. -Theodore Roosevelt", + 2: "The future belongs to those who believe in the beauty of their dreams. -Eleanor Roosevelt.", + 3: "The only way to do great work is to love what you do. -Steve Jobs.", + 4: "Everything youve ever wanted is on the other side of fear. -George Addair.", + 5: "Success is not final, failure is not fatal: It is the courage to continue that counts. –Winston Churchill.", + 6: "The strongest principle of growth lies in the human choice. -George Eliot.", + 7: "Be yourself; everyone else is already taken. -Oscar Wilde.", + 8: "Be the change that you wish to see in the world. -Mahatma Gandh.", + 9: "If people are doubting how far you can go, go so far that you cant hear them anymore. -Michele Ruiz" + } + return quotes.get(number) + +def main(): + print("Choose a number between 1-9 to receive an inpiring quote. ") + try: + number = int(input()) + quote = inspirational_quote(number) + print(quote) + except ValueError: + print("Please enter a valid number.") + +if __name__ == "__main__": + main() + \ No newline at end of file