1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
maw [93]
3 years ago
8

This assignment is to code a simple hangman game. The game should choose a random word out of a list of words that are coded int

o the program and ask for guesses. You should include a total of 20 words, lengths ranging from 4 to 12 letters long . Each time a person guesses wrong, it should decrement the total number of guesses (5 incorrect guesses allowed, on the 6th incorrect guess the game ends with a loss). When the user guesses the word or if they lose, they have the option of playing again. The expected output should be text based.
Computers and Technology
1 answer:
pshichka [43]3 years ago
7 0

Answer:

Programming language not stated.

I'll use python for this question

Explanation:

import random

# library that we use in order to choose

# on random words from a list of words

words = ['rain, 'computer', 'science', 'program, 'python', 'mathematics', 'player', 'condition','reverse', 'water', 'board', 'geeks','learn','school','days','scholar','collar','flood','house','flies']

# Function will choose one random word from this list of words

word = random.choice(words)

print("Guess the word")

guesses = ''"

# 5 turns

turns = 5

while turns > 0:

# counts the number of times a user fails

failed = 0

# all characters from the input word taking one at a time.

for char in word:

# comparing that character with the character in guesses

if char in guesses:

print(char)

else:

print("_")

# for every failure 1 will be incremented in failure

failed += 1

if failed == 0:

# user will win the game if failure is 0 and 'You Win' will be given as output

print("You Win")

# this print the correct word

print("The word is: ", word)

break

# if user has input the wrong alphabet then it will ask user to enter another alphabet

guess = input("guess a character:")

# every input character will be stored in guesses

guesses += guess

# check input with the character in word

if guess not in word:

turns -= 1

# if the character doesn’t match the word then “Wrong” will be given as output

print("Wrong")

# this will print the number of turns left for the user

print("You have", + turns, 'more guesses')

if turns == 0:

print("You Loose")

You might be interested in
A Lost link is an interruption or loss of the control link between the control station and the unmanned aircraft, preventing con
Vlad [161]

Answer:

There is nothing to answer from this statement.

Explanation:

Can you rephrase the statement into question?

4 0
3 years ago
Describe the tools that are required to accomplish each step in the data management process.
RideAnS [48]

Answer: The tools which are required to accomplish each step in the data management process are:

1. Cloud Data Management tools.

2. Master Data Management (MDM) tools.

3. Reference Data Management (RDM) tools.

4. ETL tools.

5. Data visualization and  analytics tools

Explanation:

Cloud Data Management tools with the help of various API's are able to connect multiples system with their data to the cloud. examples are amazon cloud, google API cloud.

MDM tools are used for creation and maintenance of reference data. example are Profisee

RDM tools is used with the MDM tools and are use to define the businesss processes over the reference data. Examples are Collibra.

ETL tools helps to load data of an organisation to data warehouses after transformation and testing the data pipeline constituting the data from different databases.

Data visualization  analytics tools helps to extract and generate report from the big sets of data which can help an organisation to take business decisions.

6 0
3 years ago
Read 2 more answers
How do you find the exterior angle measure of any regular polygon? (The degree in which to turn the turtle to draw a shape)
Diano4ka-milaya [45]

Answer:

360/number of sides

Explanation:

all the exterior angles add up to 360°

so to find each angle mesure, divide the 360 by the number of sides the figure has.

7 0
3 years ago
Create pseudocode to compute the volume of a sphere. Use the formula: V= (4/3)* π r3 where π is equal to 3.1416 approximately, w
MA_775_DIABLO [31]

Answer:

In geometry, the area enclosed by a circle of radius r is πr2. Here the Greek letter π represents a constant, approximately equal to 3.14159, which is equal to the ratio of the circumference of any circle to its diameter.

Explanation:

3 0
3 years ago
Read 2 more answers
What is the shortcut to select all text?
abruzzese [7]
Highlight everything with your curser.
7 0
3 years ago
Read 2 more answers
Other questions:
  • Consider a relation representing the present position of molecules in a closed container. The attributes are the ID for the mole
    12·1 answer
  • Name the component used in first generation of computer​
    10·1 answer
  • Which type of message format is designed to arouse curiosity, not showing the product or delivering quite enough information to
    10·1 answer
  • Which of the following is a strength of fiscal policy?
    15·1 answer
  • The ____ command displays the last 10 lines of a text file.
    5·1 answer
  • A recursive method without a special terminating case would _________. Hint: Self Check 13.3 had infinite number of isLucky() me
    5·1 answer
  • After spending a year in India, Giovanna returns home to the United States and is inspired to raise money to help her new friend
    14·1 answer
  • In Vista and Windows 7, the Appearance and Personalization option allows you to change the
    14·1 answer
  • What is "the last mile of broadband access"? Why is this a problem and what kind of impact does it have on the business world an
    9·1 answer
  • Which term refers to a shorthand method for identifying network and host bits in an ip address?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!