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 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
Creating "smart interfaces" in all sectors of industry, government, and the public arena is one of the fastest growing hct areas. these interfaces model, interpret, and analyze such human characteristics as speech, gesture, and vision. the field of biometrics, in which humans authenticate themselves to machines, is an area of considerable interest to hct practitioners. fingerprint scans are one of the most frequently used biometric options, and this article, biometric student identification: practical solutions for accountability & security in schools, makes a case for the implementation of fingerprint scans in schools. critique the article, and answer the following questions: according to the author, what are the main benefits of adopting fingerprint scans in schools for student identification? according to the author, what are the main drawbacks of adopting fingerprint scans in schools for student identification? do you agree with the author's assessment of the pl
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
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
Questions on the website: 13722363