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, 21.06.2019 20:20
Wireless communications is likely to be viewed as an essential part of an enterprise network infrastructure when: select one: a. mobile communication is needed b. communication facilities must be installed at low initial cost c. communication must take place in a hostile or difficult terrain that makes wired communication difficult or impossible d. the same information must be broadcast to many locations
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
Elements such as fonts colors visual structure graphics and the interface of a web page should complement each other to ensure blank
Answers: 3
question
Computers and Technology, 23.06.2019 00:00
What season was better from fortnite?
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, 13.05.2021 16:20
question
Mathematics, 13.05.2021 16:30
question
Physics, 13.05.2021 16:30
Questions on the website: 13722367