Questions
In python Using the example code from the HangMan program in our textbook, create a Word...

In python Using the example code from the HangMan program in our textbook, create a Word Guessing Game of your choice. Design a guessing game of your own creation. Choose a theme and build your words around that theme. Keep it simple.

Note: I would highly recommend closely reviewing the HangMan code and program from Chapter 10 before starting work on this project. You can run the program via my REPL (Links to an external site.).

Using python Similar to our Number Guessing game, be sure to allow the player the option to keep playing and keep score. You can design the game however you see fit but it must meet these requirements:

General Requirements

  • Remember to comment your code - include your name, date, class, and assignment title.
  • Provide comments throughout your program to document your code process.
  • Create a greeting/title to your program display output.
  • Your program should ask the player if they wish to play again.
  • Be creative! Have fun with this. Don't overthink it.

Word lists

  • You must have wordlists totaling at least 30 words to select from divided into themes or topics that you have identified. For example, say your words are all related to United States state names and world country names. You might choose to have one list named statelist and one list named countrylist. Each list might contain 15 words. Break these themes/topics into whatever works best but be sure to have at least a total of 30 words to work from.
  • Your game should randomly choose one of the words in the wordlists.

Output in python test and paste code

  • The player should be given the theme/topic of the word.
  • The player should be told how many letters the word contains.
  • The player should be shown a list of the letters that they have guessed already.
  • Output the correct guesses and location of the letters in the word. For example say the word is banana. The user has guesses the letter A as their first guess. Your output will display something like _ a _ a _ a so that the player can guess the word.
  • Your program should keep score of wins/losses and display them to the player.

Guesses in python code show

  • The player should be given ten guesses. *Note depending on the complexity of your theme/topic area you may wish to modify the maximum guesses.
  • The program should ask for a letter guess. Validate that the player inputs only 1 letter in their guess. Handle other inputs with feedback and a request to try again.
  • Your program should REMOVE the word they just played from the wordlist so they do not get the same word twice.

Think the program through

Break this down into smaller sized concepts first. Walk through the program functions step by step. Here is some of my thought processes to get you started. Thank you for helping me

  • First create your word lists and organize them by theme/topic. Maybe I want my game to be "Things You Find in a Grocery Store" and I will have 3 lists - fruits, vegetables and proteins. I will create each of my list structures and come up with 10 words for each list. fruits =["banana", "apple", "grapes", "orange", "pear", "peach", "plum"] etc.
  • Then I will try to randomly select an index from my list. I can use the random module to help me and get a value between 0 and the length of the list -1 (to take into account that the index starts at 0).
  • Once I have that part of the program working, I would celebrate my win and take a little break.
  • Next, I will store the random word from my list to a variable so that I can compare the input guesses against that word. This is where I will need to make use of string functions from Chapter 10 and use the Hangman code for inspiration.
  • I would use string functions like find() to search and find if the letter guess found a match.
  • If a match was found, I would print out a message.
  • If a match wasn't found, I would print out a message, and store the guessed letter to a list.
  • I would then output the word with the correctly guessed letters in the position they should be in.
  • and so on... until the game worked and produced the correct output.


  • Here is the book hangman code to refere to:

    import wordlist

    # Get a random word from the word list
    def get_word():
    word = wordlist.get_random_word()
    return word.upper()

    # Add spaces between letters
    def add_spaces(word):
    word_with_spaces = " ".join(word)
    return word_with_spaces

    # Draw the display
    def draw_screen(num_wrong, num_guesses, guessed_letters, displayed_word):
    print("-" * 79)
    print("Word:", add_spaces(displayed_word),
    " Guesses:", num_guesses,
    " Wrong:", num_wrong,
    " Tried:", add_spaces(guessed_letters))

    # Get next letter from user
    def get_letter(guessed_letters):
    while True:
    guess = input("Enter a letter: ").strip().upper()
      
    # Make sure the user enters a letter and only one letter
    if guess == "" or len(guess) > 1:
    print("Invalid entry. " +
    "Please enter one and only one letter.")
    continue
    # Don't let the user try the same letter more than once
    elif guess in guessed_letters:
    print("You already tried that letter.")
    continue
    else:
    return guess

    # The input/process/draw technique is common in game programming
    def play_game():
    word = get_word()
      
    word_length = len(word)
    remaining_letters = word_length
    displayed_word = "_" * word_length

    num_wrong = 0   
    num_guesses = 0
    guessed_letters = ""

    draw_screen(num_wrong, num_guesses, guessed_letters, displayed_word)

    while num_wrong < 10 and remaining_letters > 0:
    guess = get_letter(guessed_letters)
    guessed_letters += guess
      
    pos = word.find(guess, 0)
    if pos != -1:
    displayed_word = ""
    remaining_letters = word_length
    for char in word:
    if char in guessed_letters:
    displayed_word += char
    remaining_letters -= 1
    else:
    displayed_word += "_"
    else:
    num_wrong += 1

    num_guesses += 1

    draw_screen(num_wrong, num_guesses, guessed_letters, displayed_word)

    print("-" * 79)
    if remaining_letters == 0:
    print("Congratulations! You got it in",
    num_guesses, "guesses.")   
    else:
    print("Sorry, you lost.")
    print("The word was:", word)

    def main():
    print("Play the H A N G M A N game")
    while True:
    play_game()
    print()
    again = input("Do you want to play again (y/n)?: ").lower()
    if again != "y":
    break

    if __name__ == "__main__":
    main()

In: Computer Science

In John Haye’s seven step model of Change Management, contrast steps one and two. What are...

In John Haye’s seven step model of Change Management, contrast steps one and two. What are the fundamental differences between recognising a need for change and diagnosing what needs to be changed?

In: Operations Management

legal system in Uzbekistan,related to economy

legal system in Uzbekistan,related to economy

In: Economics

Explain how media affect intercultural communication. Give examples of media-induced stereotypes.

Explain how media affect intercultural communication. Give examples of media-induced stereotypes.

In: Economics

1. when michelle had only three? employees, she performed most of the? records-keeping tasks herself and...

1. when michelle had only three? employees, she performed most of the? records-keeping tasks herself and kept a general idea of finances in her head. now that her business has? expanded, she is having money problems. what should michelle? do?

A create and follow a set of finaicnal controls

B. Relinquish some of her other duties so she can focus on the money end of the business

C. take a course in financial accounting at a local college

2. One characteristic of the matrix structure is that......?

A eliminates the chain of command

B. violates the principle of unity of command

C. does away with work specialization

In: Operations Management

A graphing calculator is recommended. Solve the following exercise on a graphing calculator by graphing an...

A graphing calculator is recommended.

Solve the following exercise on a graphing calculator by graphing an appropriate exponential function (using x for ease of entry) together with a constant function and using INTERSECT to find where they meet. You will have to choose an appropriate window. (Round your answers to one decimal place.)

At 3% inflation, prices increase by 3% compounded annually.

(a) How soon will prices double?
  yr

(b) How soon will prices triple?
  yr

In: Economics

Why does it make metabolic sense for UTP to inhibit carbamoyl phosphate synthetase II, whereas ATP...

Why does it make metabolic sense for UTP to inhibit carbamoyl phosphate synthetase II, whereas ATP activates the enzyme?

In: Biology

Give at least 10 transportation and structural engineering topics for Capstone proposal or Thesis.

Give at least 10 transportation and structural engineering topics for Capstone proposal or Thesis.

In: Civil Engineering

So, I am trying to do a research about Economic and Social Cost of the Opioid...

So, I am trying to do a research about Economic and Social Cost of the Opioid Crisis in the US , So I need to write

  • background on this issue( typed please)

  • policy question and maybe a couple of paragraphs on that background and policy question and then the research question.

Please help and type it, Thanks

In: Economics

Solved parts a-e, need the rest. 1. Suppose the economy can be defined as the following:...

Solved parts a-e, need the rest.

1. Suppose the economy can be defined as the following:

Consumption Function: 3000+0.6*(Y-T)

Investment Function: 600-50r

Government Expenditure = 500; Tax = 500

Net Export = 300–30r

M = 10000

Money Demand Function: L(Y,r) =5Y–2500r

a) Derive the IS curve.

IS: r = 51.25 - .005Y

b) Derive the LM curve

LM: r = .002Y-4*(1/P)

c) Suppose P = 10, compute the equilibrium interest rate and output.

(e.g. If you compute r = 2.46, treat this as 2.46%)

r=14.357, Y=7378.571

d)Graphically illustrate the solution for part d, you should have four graphs: graph with the AD curve, the IS-

LM diagram, the Keynesian Cross (market of goods and services) and the theory of Liquidity Preference (market of real money balance).

Impact of Fiscal Policy

e)Suppose government spending increases to 700. Redo (a-d).

IS: r =53.75-.005Y, r=15.071, Y=7735.714

f)Compute the size of crowding out effect.

Crowding out size = _____________

g)Show how this increase of government expenditure affecting the graphs you draw on part (e)

(Don't need this one)

Special case

i)Suppose everything is the same, except now the LM curve is independent to interest rate, more specifically, LM : Y = 8000. Compute the equilibrium interest rates and outputs before and after the increase in government spending.

Before: r* = ____, Y* = _____

After:r* = ____, Y* = _____

j) What is the size of the crowding out effect?

Crowding out size = _______

In: Economics

Describe how the fumarate produced by the purine nucleotide cycle could be catabolized to CO2.

Describe how the fumarate produced by the purine nucleotide cycle could be catabolized to CO2.

In: Biology

We have three light bulbs with lifetimes T1,T2,T3 distributed according to Exponential(λ1), Exponential(λ2), Exponential(λ3). In other...

We have three light bulbs with lifetimes T1,T2,T3 distributed according to Exponential(λ1), Exponential(λ2), Exponential(λ3). In other word, for example bulb #1 will break at a random time T1, where the distribution of this time T1 is Exponential(λ1). The three bulbs break independently of each other. The three light bulbs are arranged in series, one after the other, along a circuit—this means that as soon as one or more light bulbs fail, the circuit will break. Let T be the lifetime of the circuit—that is, the time until the circuit breaks.

(a) What is the CDF of T, the lifetime of the circuit?

(b) Next, suppose that we only check on the circuit once every second (assume the times T1,T2,T3,T are measured in seconds). Let S be the first time we check the circuit and see that it’s broken. For example, if the circuit breaks after 3.55 seconds, we will only observe this when 4 seconds have passed, and so S = 4. Calculate the PMF of S.

(c) Finally, suppose that instead of checking on the circuit every second, we instead do the following: after each second, we randomly decide whether to check on the circuit or not. With probability p we check, and with probability 1−p we do not check. This decision is made independently at each time. Now let N be the number of times we check and see the circuit working. For example, if the circuit breaks at time 3.55, and our choices were to check at time 1 second, not to check at times 2 or 3 or 4, and to check at time 5, then N = 1, since the circuit was broken the 2nd time we checked. What is the PMF of N? (Hint: start by finding the joint PMF of N and S. It’s fine if your answer is in summation form.)

In: Math

Neo-Classical Economics assumes the perfectly competitive labor market; therefore, Neo-Classical Economics argues wage flexibility clear the...

Neo-Classical Economics assumes the perfectly competitive labor market; therefore, Neo-Classical Economics argues wage flexibility clear the labor market. In the labor market, equilibrium wage rate is determined by the demand for labor and the supply of labor, and at the equilibrium everyone who wants to work at the equilibrium wage rate finds a job.

a) Graph equilibrium in the labor market

. b) What is the unemployment rate if the labor market is at equilibrium?

c) How does the labor market adjust to new equilibrium if the demand for labor decreases sharply? Graph your answer.

d) Should government regulate the labor market, according to Neo-Classical Economics? Why or Why not? Explain your answer. e) Recently 6.6 million Americans have filed for unemployment benefit. How would a neo-classical economist approaches to this news? (8 points)

In: Economics

Quiz for Cartography 1. Which map element (e.g., LASTDOG + PADS) documents the overall purpose of...

Quiz for Cartography


1. Which map element (e.g., LASTDOG + PADS) documents the overall purpose of a map?
(a) Legend (b) Author (c)Scale (d) Title (e) Date (f) Orientation (g) Grid
(h) Map Projection (i) Positional Accuracy (j) Geodetic Datum (k) Data Sources

2. Which map elements (e.g., LASTDOG + PADS) are missing from Google Maps?
(a) Legend (b) Author (c)Scale (d) Title (e) Date (f) Orientation (g) Grid
(h) Map Projection (i) Positional Accuracy (j) Geodetic Datum (k) Data Sources

3. Which is true about a given point P (e.g., Mount Everest) on the surface of Earth?
(a) P has a unique (latitude, longitude).
(b) Given a map projection (e.g., Mercator), P has a unique (latitude, longitude).
(c) Given a geodetic datum, P has a unique (latitude, longitude).
(d) Given a time and a geodetic datum, P has a unique (latitude, longitude).
(e) Latitude and longitude for P vary over 100m across different Geodetic datum
(f) Major earthquakes may change Latitude and longitude for P by several meters

4. Which is true about the North determined by a (stationary) compass (or a compass app)?
(a) Away from poles, it points towards the North Star (Polaris) in the sky.
(b) Away from poles, it points towards the true north (direction along a longitude towards the geographic North Pole).
(c) Away from poles, it points towards the magnetic (north) pole.
(d) At magnetic pole, it points towards the true north.
(e) At geographic North Pole, it points towards the magnetic pole.

5. Which spatial relationships are preserved by a topological map, e.g., sub-way maps?
(a) connectivity between stations via train lines
(b) distances between stations along train lines
(c) absolute geographic direction (e.g., north, east) between stations
(d) relative direction between stations along train lines

6. Choropleth maps show statistical data aggregated over previously defined regions (e.g.,
states, countries). In contrast, Isarithmic maps define region
boundaries based on data. Divide the following maps into either Choropleth or Isarithmic:
(a) Topographic maps showing iso-elevation contours
(b) Census maps
(c) Election Map to convey results of an Election
(d) Weather forecast maps showing areas of sunshine, clouds, rain, snow, ...
(e) Accessibility map showing commute time to a city center
(f) Hotspot map showing elliptical regions of unusually high density of disease (or crime)
(f) Google map app showing a phone's location as a standard deviation circle around a mean point (center point)

7. Which font properties are used in text labels to denote fluid nature of water bodies?
(a) Serif fonts (a) San Serif fonts (c) Italics (d) Blue color

8. Which is not a common characteristic of a well-designed cartographic map?
(a) clarity and legibility (b) order (c) beauty (d) realism
(d) balance (e) Unity and Harmony (f) visual hierarchy (g) visual contrast

9. Match colors to map layers in common maps:
(a) Colors are black, blue, brown, green, red, yellow
(b) Map layers include arid areas, forests, mountains, place names, sea surface temperature, water

10. Consider a map for wind energy farm development. Classify the following map layers into
foreground and background for this map: country boundaries, roads, lakes, place names, transmission lines, wind-mills.

In: Computer Science

Discuss the general purposes of taxes? Give examples. How politically popular is it for government to...

  1. Discuss the general purposes of taxes? Give examples.
  1. How politically popular is it for government to reduce spending and/or to raise taxes? Explain.

In: Economics