Computers and Technology

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()

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 12:30, caden8233
Which is the best web development company in pakistan?
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, bowmanari2154
What is used to analyze and summarize your data without graphical support
Answers: 1
image
Computers and Technology, 23.06.2019 08:30, Calirose
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
image
Computers and Technology, 23.06.2019 10:00, thezbell
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
Do you know the correct answer?
So for some reason my random number generator just breaks my code and i want to know how to make my...

Questions in other subjects:

Konu
Mathematics, 27.01.2020 23:31