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
Think about how you view your emails—either the email service you use yourself or an email service you would choose to use. Desc
Assoli18 [71]

Answer:

and POP3, followed in later years. POP3 is still the current version of the protocol, though this is often shortened to just POP. While POP4 has been proposed, it's been dormant for a long time.

IMAP, or Internet Message Access Protocol, was designed in 1986. Instead of simply retrieving emails, it was created to allow remote access to emails stored on a remote server. The current version is IMAP4, though most interfaces don't include the number.

The primary difference is that POP downloads emails from the server for permanent local storage, while IMAP leaves them on the server while caching (temporarily storing) emails locally. In this way, IMAP is effectively a form of cloud storage.

7 0
2 years ago
What statement is accurate in regards to
lorasvet [3.4K]

The statement that is accurate in regards to sharing workbooks is that You must add the feature to the Quick Access Toolbar

<h3>What does a shared workbook implies?</h3>

The term connote the act of sharing an Excel file. Here, a person can give other users any form of access to the same document.

Sharing workbook is one that allow people to make any kinds of edits at the same time, which saves a person the trouble of keeping track of different versions.

Learn more about workbooks from

brainly.com/question/5450162

7 0
2 years ago
What doyou mean by process model and project model?
vlabodo [156]

Answer:

A process model is a narrative of each type of process. These models consist of processes that are inherently similar and are categorized accordingly; a logical set of actions executed in a comprehensible framework.

A project model is concise and visual, it depicts how a project will be implemented. They are specifically tailored according to each project, describing each of its functional aspects. Decision gates and partitions are important aspects and need to be exemplified throughout the project.

4 0
3 years ago
Like when writing a paragraph, the subject becomes the __________ of the photograph.
Natali5045456 [20]
It is A, the theme is the subject.
8 0
3 years ago
You have recently implemented a new WAN technology to connect a remote branch office to your headquarters. While making VoIP cal
sergejj [24]

Answer:

Satellite is the correct answer to the given question .

Explanation:

Connections via the  satellite deliver the communication in the whole  world environment .The  reliability, expense and the performance problems have long suffered satellite connections, rendering the satellite-based WAN connections are just under the suitable.

The satellite wan connection is the Linking of  the head office to a remote branch office.The satellite wan technology  allowing the VoIP calls between both the departments .When the workers complain about discrepancies between something talking as well as the other person learning.

5 0
3 years ago
Other questions:
  • Suggest two other subtasks that may be performed in a dice game?
    15·2 answers
  • Suppose your parents are planning to take you
    8·1 answer
  • Consider a satellite orbiting the earth. Its position above the earth is specified in polar coordinates. Find a model-view matri
    12·1 answer
  • Discuss trends in cellular data transmission speeds
    15·2 answers
  • Need help please will mark brainliest
    15·1 answer
  • $8.25/hour; _____$/year, when working 40 hours a week.
    6·1 answer
  • What is a geam in the ggplot2 system?
    5·1 answer
  • A driver that approaches a controlled intersection with a signal that is not working must:
    12·1 answer
  • 3. Cellular phone technology works on a system of geographically separated zones
    12·1 answer
  • Select the four bad password ideas.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!