-
Notifications
You must be signed in to change notification settings - Fork 37
Issues: Matilla/Python_Ejemplos
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Author
Label
Projects
Milestones
Assignee
Sort
Issues list
import random # list of possible fish to catch fish = ["trout", "salmon", "bass", "catfish", "tuna"] # player starts with 3 fishing trips trips = 3 while trips > 0: print("You have", trips, "fishing trips left.") print("You cast your line and wait...") # randomly choose a fish from the list to catch catch = random.choice(fish) # player has a 50% chance of catching a fish if random.randint(0, 1) == 1: print("You caught a", catch + "!") else: print("You didn't catch anything. Better luck next time.") # player loses one fishing trip trips -= 1 print("You're out of fishing trips. Come back soon!")
#5
opened Jan 11, 2023 by
mrwanoubaba
ProTip!
no:milestone will show everything without a milestone.