-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit ad4d0fc
Showing
6 changed files
with
244 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,74 @@ | ||
print(""" _ | ||
.(o)`---.--...__.-.__ | ||
.'.' '-.-..--._.--._.(o)`---...-.____ | ||
.'.' | | .:' .:'| |'--._..--'-.(o)---...._____ | ||
.'.' .'| |.:' .:' |.| | | | |`---.`--..--._.-.(o) | ||
.'.' .' ||.|-._.-.:'_.-_-.| | | | | ||.:' .:'|| | |-| | ||
.'.' .' || | ' ' | | . | | ||-._.--'._.|| | | | | ||
.'.'|.'' || | ' ' | | | | | || ' ' || | | | | ||
'.'_||| ' || | ' ' | | | | | || ' ' || | | | | ||
||| ' || | _ _ _ _ _ _ | | | / | || ' || | | | | ||
||| ' .| || | | | | | | | | . ' '-----....._|' | | | | ||
||| .' | || | | | | | | |.|'' ----.... ____ ' | | | ||
||| .' |>][<| | | | | | | |--- .. -- ... -- | | | ||
|||.' .|.|| | | | | | | | |-..__ _ __ ..| | | ||
|| .' | || | | | | | | | | '''-----. _ -- | | | ||
||.' | || | | | | | | ||| .. - -... .. | | | ||
|| .' | || | | | | | | | |--..____ ... ''''''''- | | | ||
|| .' |>][<| | | | | | | | -- __ ....| | | ||
||' .' | || | | | | | | | |--- . .....__ .. | | | ||
|| .' ' .'| ||_|_|_|_|_|_| | |. ___ .-. '-' | | | ||
|| .' | |_____________/(o)__ .... '''' /(o) ... | | | ||
||.' .' (o)=====]======[ //(o)=============/ //==(o)='=| | ||
|| .' .' | |// | | / // // /.' | ||
||(o)\' \ | |/ / / / // //`/ | ||
_ LGB || \\ \ | =|======|= | / /`// // / | ||
`-._.||==\\.\=====\ | | .' | |====/ //===// / | ||
`-. \\ \ |`-. | | | / / / // //`/ | ||
-._ `-. `-. \\ \ | =|======|= || | / // //./ _.-- | ||
`-.. `.\\`\ \ | | . './ /`// .\ / .. --' | ||
`.. `-. `\\ \ |`. | | .' ' | / // //\\-`' | ||
`-. \\`\| =|======|= \ / // .-' \\ .-` .` | ||
`. `. \\/. -' | | / //-' .` \\ _.-' | ||
`. // \ | | .' ' /`// ` \\ _..-' | ||
\ //.\/. =|======|= / // ` _.`` | ||
`. // // \ | | / // .-` _.' | ||
'/ // \ | | .' / // _.' | ||
`.// =|======|= / // .-' | ||
'/ `. | | /.// .' | ||
`. . | | /-// .' | ||
`. =|======|=/ // / | ||
\ | |/ // | | ||
| | |`// / | ||
\ =|======|=/ .' | ||
| | / |/ .| | ||
\ | / /| .'\ | ||
|=|======|= | | | ||
| | | | | | ||
| | | | ||
""") | ||
|
||
print("welcome to treasure Island!\n Your mission is to find the hidden treasure.\n ") | ||
option = input("You are at a crossroad. Where do you want to go?\n Type 'left' or 'right' \n") | ||
|
||
############################## | ||
option = option.lower() | ||
if option == 'right': | ||
print("You fell into a hole, game over") | ||
elif option == 'left': | ||
mode_of_transportation = input("do you want to swim or wait for a boat?\n") | ||
mode_of_transportation = mode_of_transportation.lower() | ||
if mode_of_transportation == "swim": | ||
print("Game over!") | ||
elif mode_of_transportation == "wait": | ||
print("the boat has arrived, enter the boat to cross the river.\n You are now at the door.") | ||
choose_door = input("which door do you want to enter? blue, red, yellow?\n") | ||
choose_door = choose_door.lower() | ||
if choose_door == "blue": | ||
print("Game Over!") | ||
elif choose_door == "red": | ||
print("Game over!") | ||
elif choose_door == ("yellow"): | ||
print("Hurray!!, you have found the treasure, it is an ancient Ruby that belongs to king Xerxes") | ||
else: | ||
print("kindly read the instruction again") |
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,13 @@ | ||
#Create a greeting for your program | ||
print("welcome to the band name generator.") | ||
|
||
#Ask the user for the city that they grew up in | ||
city = input("Which city did you grow up in?\n ") | ||
|
||
#ask the user for the name of their pet | ||
pet = input("what is the name of your pet?\n ") | ||
|
||
#combine the name of their city and pet and show their band name | ||
print("Your band name could be " + city + " " + pet) | ||
|
||
#make sure the cursor shows on a new line. |
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 @@ | ||
age = int(input("what is your current age?\n")) | ||
|
||
yearRemaining = 90 - age | ||
|
||
days = yearRemaining * 365 | ||
weeks = yearRemaining * 52 | ||
months = yearRemaining * 12 | ||
|
||
message = f"you have {days} days, {weeks} weeks, {months} months left to live" | ||
print(message) |
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,17 @@ | ||
print("welcome to the tip calculator!") | ||
|
||
total_bill = float(input("what was the total bill? \n$")) | ||
tip = int(input("what percentage tip will you like to give? 10, 12 or 15?\n")) | ||
people = int(input("how many people are spliting the bill?\n")) | ||
|
||
|
||
|
||
bill_with_tip = tip / 100 * total_bill + total_bill | ||
|
||
bill_per_person = bill_with_tip / people | ||
|
||
total_pay = round(bill_per_person,2) | ||
total_pay = "{:.2f}".format(bill_per_person, 2) | ||
print(f"each person should pay ${total_pay}") | ||
|
||
|
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,76 @@ | ||
import random | ||
|
||
rock = ''' | ||
---.____ ,/k. | ||
___,---' / ih,__,-----.___ | ||
,-' , `:7b----.__---` | ||
_.-/ ' /b.`.4p, | ||
--" , ,-' ^6x, `."^=._ | ||
''' | ||
|
||
|
||
paper = ''' | ||
_.-._ | ||
| | | |_ | ||
| | | | | | ||
| | | | | | ||
_ | '-._ | | ||
\`\`-.'-._; | ||
\ ' | | ||
\ .` / | ||
jgs | | | ||
''' | ||
|
||
|
||
|
||
scissors = ''' | ||
_ ,/' | ||
(_). ,/' | ||
_ :: | ||
(_)' `\. | ||
`\. | ||
''' | ||
|
||
#0 = rock, 1 = paper, 2 = scissors | ||
game_images = [rock, paper, scissors] | ||
|
||
players_choice = int(input("what do you choose? Type 0 for Rock, 1 for Paper or 2 for Scissors.\n")) | ||
|
||
if players_choice >=3 or players_choice < 0: | ||
print("You typed an invalid number, please follow the instructions") | ||
else: | ||
print(game_images[players_choice]) | ||
|
||
computers_choice = random.randint(0,2) | ||
|
||
print("You chose:") | ||
print(game_images[players_choice]) | ||
|
||
print("Computer chose:") | ||
print(game_images[computers_choice]) | ||
|
||
|
||
|
||
if players_choice >=3 or players_choice < 0: | ||
print("You typed an invalid number, please follow the instructions") | ||
|
||
if players_choice == computers_choice: | ||
print("Game ends in a draw!") | ||
elif computers_choice == 2 and players_choice == 0: | ||
print("you win!") | ||
elif players_choice == 2 and computers_choice == 0: | ||
print("you loose!") | ||
elif computers_choice > players_choice: | ||
print("you loose!") | ||
elif players_choice > computers_choice: | ||
print("you win!") |
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,54 @@ | ||
import random | ||
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', | ||
'h', 'i', 'j', 'k', 'l', 'm', 'n', | ||
'o', 'p', 'q', 'r', 's', 't', 'u', | ||
'v', 'w', 'x', 'y', 'z', 'A', 'B', | ||
'C', 'D', 'E', 'F', 'G', 'H', 'I', | ||
'J', 'K', 'L', 'M', 'N', 'O', 'P', | ||
'Q', 'R', 'S', 'T', 'U', 'V', 'W', | ||
'X', 'Y', 'Z'] | ||
|
||
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] | ||
symbols = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '?', '>', '<'] | ||
|
||
|
||
print("Generate a password") | ||
choose_letters = int(input("How many LETTERS do you want in your password? \n")) | ||
choose_numbers = int(input("How many NUMBERS do you want in your password? \n")) | ||
choose_symbols = int(input("How many SYMBOLS do you want in your password? \n")) | ||
|
||
|
||
password_list = [] | ||
|
||
|
||
for letter in range(1, choose_letters + 1): | ||
password_list.append(random.choice(letters)) | ||
|
||
|
||
|
||
|
||
for number in range(1, choose_numbers + 1): | ||
password_list.append(random.choice(numbers)) | ||
|
||
|
||
|
||
|
||
for symbol in range(1, choose_symbols + 1): | ||
password_list.append(random.choice(symbols)) | ||
|
||
|
||
print(password_list) | ||
random.shuffle(password_list) | ||
print(password_list) | ||
|
||
## | ||
##password_list = " ".join(str(x) for x in password_list) | ||
##print(password_list) | ||
#or | ||
|
||
password = ' ' | ||
|
||
for character in password_list: | ||
password = password + character | ||
print(f"Your password is {password}") | ||
|