Create a while loop to try making a video game turn based battle.
Then have a monster health value and a player health value.
The player can then choose to attack, heal, or do magic.
If they choose to attack, roll one die and take that damage away from the monsters health.
If they choose to heal then add a dice roll to the player's hp.
If they choose magic then take two dice rolls away from the enemy.
The enemy attacks every turn with 1 dice roll.

Answers

Answer 1

import random

monster_health = 20

player_health = 20

while player_health >0 and monster_health>0:

   player_choice = input("Do you wish to attack, heal, or do magic? (type attack, heal, or magic) ")

   if player_choice == "attack":

       damage = random.randint(1,6)

       monster_health -= damage

       print("You attack the monster for",damage,"points of health. The monster has",monster_health,"points of health")

   elif player_choice == "heal":

       heal = random.randint(1,6)

       player_health += heal

       if player_health>20:

           player_health = 20

       print("You heal for",heal,"points of health. Your health is now at",player_health)

   elif player_choice == "magic":

       total = 0

       for x in range(2):

           total += random.randint(1,6)

       monster_health -= total

       print("You attack the monster for",total,"points of health. The monster has",monster_health,"points of health")

   if player_health < 1 or monster_health <1:

       break

   monster_damage = random.randint(1,6)

   player_health -= monster_damage

   print("The monster attacks your for",monster_damage,"points of health. You have",player_health,"points of health remaining.")

if player_health < 1:

   print("You died! Better luck next time!")

elif monster_health < 1:

   print("You defeated the monster! Great job!")

I wrote my code in python 3.8. Best of luck.


Related Questions

What natural resources products are discussed in the article? Are they renewable or nonrenewable?

Answers

Where is the article

Nonrenewable energy resources, like coal, nuclear, oil, and natural gas, are available in limited supplies. This is usually due to the long time it takes for them to be replenished. Renewable resources are replenished naturally and over relatively short periods of time.

PLEASE HELP!!!!


Which of the following statements about content-based filtering is TRUE?

A. With content-based filtering, users receive recommendations for items liked by similar users.

B. With content-based filtering, users receive recommendations for items that are similar in type to ones they already like.

C. Both A and B are true

D.Neither A nor Bare true​

Answers

Answer:

D

Explanation:

It means its based on things similar to what you are reading or looking at.

The statement that is true about content-based filtering is; A. With content-based filtering, users receive recommendations for items liked by similar users.

What is Content based Filtering?

Content-based filtering is defined as a type of recommender system that attempts to guess what a user may like based on that user's activity.

Now, from the given options we can say that option A is correct because it matches the description we have above about Content based filtering.

Read more about Content based filtering at; https://brainly.com/question/10043488

#SPJ9

Write a program to show the grade obtained by a student after he/she enters their total mark percentage. Program should accept an input from the user and display their grade as follows Mark Grade < 90 A 80-89 B 70-79 C 60-69 D 50-59 E < 50 Failed

Answers

Write a program to show the grade obtained by a student after he/she enters their total mark percentage. Program should accept an input from the user and display their grade as follows Mark Grade < 90 A 80-89 B 70-79 C 60- the answer would 89 B:C cause that's then the things were alive.

.WAP to enter monthly sale of Salesman and give him commission i.E. If the monthly sale is more than 500000 then commision will be 10% of monthly sale otherwise 5%

Answers

sales = float(input("Enter monthly sales amount: $"))

commission = 0.05

if sales> 500000:

   commission = 0.1

print("You earned: $"+str(sales*commission))

I wrote my code in python 3.8. I hope this helps.

4. Why does Hancock believe that our communication online is more honest than we might
expect?

Answers

Answer:

The reason we are more honest online is simpler than we think, says Hancock. In the past, before there was modern technology or even written language, people could lie to each other easily. Once the words were said, they disappeared. ... Technology therefore might make us more honest than ever

Answer:

Hancock believes that communication online can be more honest because in the past, before modern technology or even written language, technology makes communications written conversation make you reliable if you can't/or don't delete or unsend the messages. That might make people more honest than ever.

Viewport: Fresh User Location: Outside of the Viewport What is the correct technique when measuring the distance of a result outside of the viewport?A. Measure from the outer edge of the viewportB. Measure to the center of the viewport (device icon)C. Measure to the User locationD. All of the Above

Answers

Answer:

The answer is "Option A".

Explanation:

It's also better and measures the distance returned to a viewport to accomplish the right angle from the result produced outside the viewfinder. Its reason for this is that the outer edge of a perspective is where all the perspective begins.

The Viewport is a new client location that is the outside of the Viewfinder that Calculates the distance with an external edge of a viewfinder from the outside of the viewfinder is a methodology.

prepare a model of an editorial on "social problems and evils are the adversary factors of progress and prosperity"​

Answers

Answer:Social problems are the issues that are collectively faced by a society. It is not only related to one individual but a whole society. For example; illiteracy, poverty, infanticide, child abuse, child labour etc.

Social problems are the issues that are collectively faced by a society. It is not only related to one individual but a whole society. For example; illiteracy, poverty, infanticide, child abuse, child labour etc. Social evils are those activities that negatively affect a country. For example; alcoholism, drug abuse, prostitution etc.

Social problems are the issues that are collectively faced by a society. It is not only related to one individual but a whole society. For example; illiteracy, poverty, infanticide, child abuse, child labour etc. Social evils are those activities that negatively affect a country. For example; alcoholism, drug abuse, prostitution etc. Both social problems and evils badly affect a country. They are a hurdle in the development of the country.

Thanxxxx

Explanation:

use of the Internet to access programs and data on computers that are not owned and managed by the user often using large data centers

Answers

Answer:

Cloud computing

Explanation:

Given that Cloud computing is a term that is used in explaining the method in which the users utilize big data centers like Amazon Web Services, Microsoft Azure, etc, to carry out functions such as storing and accessing created data and files, and formation of the database online without saving it on the user's computer.

Therefore, CLOUD COMPUTING is the use of the Internet to access programs and data on computers that are not owned and managed by the user often using large data centers.

Type the correct answer in the box. Spell all words correctly.

Which spreadsheet program the BLANK option will allow Lily to arrange data in chronological order?

Lily needs to arrange data in a spreadsheet in reverse chronological order. The
option will allow Lily to perform this task.

Answers

Answer:

That would be the SORT option.

Explanation:

The sort option allows you to sort them in orders such as newest to oldest and oldest to newest.

Answer:SORT

Explanation:

what is The Impact Of Technology On Real Estate

Answers

Answer:

Technology can help real estate agents predict the future values of properties in the market. For most consumers purchasing a new home is an investment, but having a reliable source of value and future value, will make them more confident in investing into that property.

Explanation:

Nadia has inserted an image into a Word document and now would like to resize the image to fit the document befter. What is the quickest way to do this? keyboard shortcut sizing handles context menu sizing dialog box ​

Answers

Answer:

To resize the document, Nadia needs to press

Command +>/ Ctrl+> to increase the size of the frame and its contents by 1%.

Or press Command +</ Ctrl+< to decrease the size of the frame and its contents by 1%

In a single paragraph, write about the development of HTML and its relevance to the growth of the Internet.

Answers

Explanation:

This chapter is a short history of HTML. Its aim is to give readers some idea of how the HTML we use today was developed from the prototype written by Tim Berners-Lee in 1992. The story is interesting - not least because HTML has been through an extremely bumpy ride on the road to standardization, with software engineers, academics and browser companies haggling about the language like so many Ministers of Parliament debating in the House of Commons.

1989: Tim Berners-Lee invents the Web with HTML as its publishing language

The World Wide Web began life in the place where you would least expect it: at CERN, the European Laboratory for Particle Physics in Geneva, Switzerland. CERN is a meeting place for physicists from all over the world, where highly abstract and conceptual thinkers engage in the contemplation of complex atomic phenomena that occur on a minuscule scale in time and space. This is a surprising place indeed for the beginnings of a technology which would, eventually, deliver everything from tourist information, online shopping and advertisements, financial data, weather forecasts and much more to your personal computer.

Which of these cannot be used to open a zip file?
O WinZip
O WordPad
File Viewer Plus
O Apple Archive Utility

Answers

Answer:

c

Explanation:

bc

Word templates include pre-made flyers which may be edited and saved only if permission is obtained from the Microsoft Office teacher.

Question 3 options:
True
False

Answers

the answer will be true

state two types of files which can be accessed by online download servers

Answers

FTP and Online Sharing Services

Karen wants to create a program that will allow the user to input their age. Which of these lines of code should be used?
print("What is your age?")
age = ("What is your age?")
age = input("What is your age?")
age = ask("What is your age?")

Answers

Answer: age = input("What is your age?")

Explanation: Since this is the syntax for inputing a variable and storing it as age

Answer:

Answer is age=input(what is your age)

Explanation: Its right because age=input your inputting your age and what is asking you hopefully it helped have a good day :)

What is the full path and filename for the file on a Debian Linux distribution that displays the time zone settings?

Answers

Answer:

/etc/timezone

Explanation:

Debian based Linux distribution is a free distribution software and an operating system. It is composed of a open source and free source software. It is one of the most popular distributions.

A computer file name is a unique system of identifying the computer stored file in the file system. The names of the different file system have different formats or extensions in the file name and imposed different file restrictions.

In the context, the full path and the file name of a file that displays a time zone settings on a Debian Linux distribution is " ../etc/timezone".

Storage.
• Mouse
• Laser Printer • Hard Disk
• Speaker • Joystick
Digital Video Camera
- CD-ROM
• Scanner
• Monitor
Microphone
Answer the following.
List the four basic hardware components of
computer.
What is an input device? Name some input devices an
mention what they are used for.
Megha Computer Science - 6​

Answers

Answer:

Part A

1) Mouse

2) Monitor

3) Hard Disk

4) Joystick

Part B

i) An input device is used to provide input signal to the computer or other information technology system for processing

ii) scanners, joysticks, mouse, and keyboards

iii) a) A scanners is used to create digital image input

b) A joystick is mainly used in gaming

c) The (computer) mouse is moved on a flat surface to navigate the mouse pointer

d) A (computer) keyboard is used for data input into the

Explanation:

Part A

The list of the four basic hardware components of computer are;

1) Mouse

2) Monitor

3) Hard Disk

4) Joystick

Part B

i) An input device is an equipment with which computer control signal and data are entered into a computer or other forms of technology for processing information.

ii) Input devices includes, scanners, joysticks, mouse, and keyboards

iii) a) A scanners is used to create digital image input for the computing system

b) A joystick (mainly used in gaming) consists of stick with control buttons that pivots on an attached base whose movement and control button input are reported to the information technology processing system, such as a computer to which it is attached

c) The (computer) mouse is moved on a flat surface to navigate the mouse pointer displayed on a graphical user interface for controlling and operation of a computer

d) A (computer) keyboard is a primary computer input device that is very much similar to a typewriter keyboard in design and functioning

Data input to the computer are made by typing values using the keyboard

In cell B3, insert a nested MATCH function within an INDEX function that will look up the rental price in column D using the apartment number referenced in cell B2. With 101 entered in cell B2, the lookup function displays $950.00.

Answers

Solution :

Step 1:

Open the excel exploring_e07_grader_h1_Apartment.xlsx and save it as exploring_e07_grader_h1_Apartment_LastFirst.

Step 2:

At cell G8 in the Summary worksheet, insert the date function to the number of Years since remodel:

Compute the difference between the years 1/1/2018 value in the cell H2 and the Last remodel date present in cell F8 which returns the number of days.

Then, divide the resultant by 365 days to get the answer in the form of years.

The formula to compute the number of years since remodel at cell G8 is,

 =($H$2 - F8)/365.25

Copy the function used in the cell G8 to the cells G9:G57.

Step 3:

At cell H8 in the Summary worksheet, insert the function to compute the pet deposit.

Condition to check is whether the number of rooms that is at Cell C8 is greater than or equal to 2 and it is remodel less than 10 years ago.

If the condition is true, then pet deposit cost is $275 present at cell H4.

Otherwise the pet deposit cost is $200 present at cell H5.

So, the formula to apply at cell H8 is,

=IF(AND(C8>=2, G8<$H$3), $H$4, $H$5)

Step 4:

At cell I8 in the Summary worksheet, insert the function to display Need to Remodel:

Condition to check is whether the apartment is unoccupied depending on the cell E8(“Yes” or “No”) and last remodeled that is cell G8 is greater than 10 years (cell H3).

If the condition is true, then display as “No Change”.

Otherwise display as “Need to Remodel”.

So, the formula to apply at Cell I8 is,

=IF(_AND(_E8="No", G8>$H$3), "Need to Remodel", "No Change")

Step 5:

Copy the functions used in the cells H8:I8 to the cell range H9:I57.

Step 6:

At cell B3, to display the rental price:

By using Index function look up for the rental price present in Column D and check for the match of cell B2 with respective the Column Range A8:A57.

Syntax for INDEX function is:

=INDEX(Array, Row number, Column number)

Syntax for MATCH function is:

=MATCH(Loop up, Loop up array, Match type)

So, the function to be inserted at cell B3 is,

 =INDEX($D$8:$D$57, MATCH(B2, $A$8:$A$57,0))


(6) A man buys some chocolates for Rs. 30.25, noodles for Rs. 65.25 and biscuits for Rs.
85.50. If he gives Rs. 200 to the shopkeeper, how much money will he get return back​

Answers

19 Rs ( अनीस रुपए)

Explanation:

that is 200

How would you delete a slide from your presentation after selecting it?

Answers

you right click on your mouse then a thingy majigy should come up then press delete slide ;)

What is problem scoping

Answers

Answer:

the process that people use to figure out what problem they’re solving

Explanation:

TRUE OR FALES

1.Windows 98 is not a GUI-based operating system.

Answers

Answer:

TRUE

Explanation:

t is a graphical user interface (GUI) based operating system. Which makes our operation interactive and easy to use. Windows 98 is an improved version of Windows 95. Main feature in windows 98 is its 'Desktop'.

In his paper, Mario rephrases his description of food deserts. Read his description below. Food deserts are places that lack access to healthy, fresh food. He wants to use another word for "access” in his description. How can Mario complete his task without leaving the Word application? Use a browser to find a synonym of the word. Use the Tell me bar to find a synonym of the word. Use the Thesaurus feature to find a synonym of the word. Use the Smart Lookup feature to find a synonym for the word.

Answers

Answer:

C.

Explanation:

Answer:

C.

Explanation:

I just took it

why does elephant has thicker legs? Explain in terms of breaking stress?​

Answers

Answer:

Since volume is proportional to area, volume is inversely proportional to pressure.

An elephant has a greater weight towards Earth's surface, so it has a larger legs of larger volume which exerts less pressure on Earth's surface in order to prevent it from immersing in soil, or soft land

What are some ways to cut down on repetitive code in your website?​

Answers

Answer:

using functions or loops

Explanation:

Functions allow you to repeat code execution simply by calling the function containing the code that needs to be repeated multiple times.

Loops also allow you to execute the same code repeatedly.

What is it called when servers on the Internet supply applications as a service, rather than a product

Answers

Answer:

cloud computing

Which of the following is a good way to keep your knowledge of Internet technology current? Select all that apply.


Find a mentor in the field.
Monitor technical website discussion boards.
Attend local career days.
Research organizations dedicated to advancing the Internet.

Answers

Answer:

Find a mentor in the field.

Monitor technical website discussion boards.

Attend local career days.

Research organizations dedicated to advancing the Internet.

When do I use while loops

Answers

Answer:

When you dont know how long the loop is going to run for

Explanation:

state differences between title bar and menu bar​

Answers

Answer:

The answer to this question is given below in this explanation section.

Explanation:

                              "Title bar"

A title bar is a small strip that extends across the top of a window.It display the title of the window and typically include the close minimize and maximize button.In macros these buttons are on the left side of the title bar while in windows they are on the right.The title bar is a horizontal bar located at the top of a window in a GUI.It displays the title of the software name of the current.

                                   "Menu bar"

A menu bar is a graphical control elements which contains drop down menu.The menu bar purpose is to supply a common housing for window or application specific menu which provide access to such function as opening file interaction with an application or displaying help documentation or manuals.

Other Questions
Josslyn needs to earn at least $420 a week during her summer break to pay for college. She works two jobs, one at a restaurant that pays $18 an hour and the other tutoring for $16.50 per hour.Let x be the number of hours she works at the restaurant and let y be the number of hours she works tutoring. Write an inequality that models this situation. PLEASE HELP ME!!!!!!!! What is the slope of the line y=3A. 3B. -3C. 0D. Undefined What is special about y coordinate that goes with the x coordinate of 1on a proportional gragh a highschool student refuses to participate in the pledge of allegiance Describe two ways to founding fathers created to ensure that US president will never be as powerful as a British king A druggist has two mixtures of a certain chemical and water, one containing 10% of the chemical and the other containing 40% of the chemical. How much of each mixture should he use to make 10 ounces that contain 25% of the chemical? How many ounces of chemical are in the final mixture? 1 2.5 7.5 A woman exerts a horizontal force of 113 N on a crate with a mass of 31.2 kg.a. If the crate doesn't move, what's the magnitude of the static friction force (in N)?b. What is the minimum possible value of the coefficient of static friction between the crate and the floor? What were three weaknesses of non European redound that allowed European powers to control or colonize them circuit?- How far would Santa travel if he was going90miles/minute for 1 hour? Predict the next number in the sequence: 1, 4, 16, 64512244384256 If I do my maths homework at a rate of 1.6 questions per minute, it will take me 47 minutes to complete. What rate is needed to complete it in 34 minutes?Give your answer correct to 1 decimal place. How do you find the precipitate in chemistry? When consumers eat plants, they break them down to release chemical energy their bodies can use.What is the original source of this chemical energy?Select one answerA.) Soil.B.) Minerals..) Water.D.) Sunlight. The angles below are supplementary, What is the value of x? What type of cost will reduce with the introduction of a CAM system in a manufacturing plant?A.capital costB.fixed costC.labor costD.material cost 6,6,5,5, 4, 7,4,8, 4, 6, 5, 7,8Find the modes of this data set. whats the mode? (4w^2 -m) - (-15w^2)(ill give brainliest) Eddie went to Luke Base Air Force Show and brought $55 with him to spend. If admission cost him $5 and sodas were $6.25 each, what is the GREATEST number of sodas, x, Eddie can buy? USE x AS VARIABLE; NO SPACES. Mindy is speaking at community event to help people understand the importance of healthy eating. Which dtaent best described monster behavior Steam Workshop Downloader