subject

So for some reason my random number generator just breaks my code and i want to know how to make my random generator to pick 5 numbers out of 10. here's my code:

# fallout console edition

import random

def main():

# base dialouge for beginning of game.

print("hello, welcome to the fallout event, a python made rpg.")

# simple character info

character_gender = input("enter your character's gender: ")

character_name = input("enter your character's name: ")

character_health = 100

# intro

keep_going = input("enter '25 cents'to play and after dieing enter '25 cents'. ")

print("your beloved vault 23, your own friends and family have cast you out due to your behavior as a, per say, loose cannon. before being cast to the wasteland, you were given an old pipboy-3000 and with it you have entrusted your life. with the pipboy you will store items to your inventory and so on.")

while keep_going == '25 cents' :

print("after leaving glorious vault 23, you find a crate and find five items ")

# failed attempt at trying to give you 5 random items from the crate but it just breaks.

for x in range(5):

random_number = random. randint(1,10)

if random_number == 1:

print("you have found a 10mm pistol(+ 20 ap)! ")

if random_number == 2:

print("you have found a switchblade(+ 10 ap)! ")

if random_number == 3:

print("you have found a stimpak(+ 50 hp)! ")

if random_number == 4:

print("you have found a tube of wonderglue! ")

if random_number == 5:

print("you have found a coffee mug! ")

if random_number == 6:

print("you have found a old baseball! ")

if random_number == 7:

print("you have found an antique globe! ")

if random_number == 8:

print("you have found a gold platted flip lighter! ")

if random_number == 9:

print("you have found a box of blamco mac and cheese(+ 25 hp)! ")

if random_number == 10:

print("you have found a raider chest piece(+1 to defense)! ")

main()

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
List the five on-board vehicle subsystems
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
How can a user delete a drawing object
Answers: 1
question
Computers and Technology, 23.06.2019 06:40
What are the three uses of a screw?
Answers: 2
You know the right answer?
So for some reason my random number generator just breaks my code and i want to know how to make my...
Questions
question
Mathematics, 16.12.2020 21:40
question
Social Studies, 16.12.2020 21:40
question
Mathematics, 16.12.2020 21:40
question
Mathematics, 16.12.2020 21:40
question
Mathematics, 16.12.2020 21:40
question
Mathematics, 16.12.2020 21:40
question
Mathematics, 16.12.2020 21:40
Questions on the website: 13722361