Question
Code # Hangman game! # Assume the answer is hangman A = ['h','a','n','g','m','a','n'] L = ['_','_','_','_','_','_','_'] play = True while play == True: #Ask the
Code
# Hangman game!
# Assume the answer is "hangman"
A = ['h','a','n','g','m','a','n']
L = ['_','_','_','_','_','_','_']
play = True
while play == True:
#Ask the user to guess a letter
letter = str(input("Guess a letter: "))
# Check to see if that letter is in the answer
i = 0
for currentletter in A:
# If the letter user guessed is found in the answer,
#and if so, end the loop
if A == L:
play = False
print ("GREAT JOB!")
7. Use a Python library to access a dictionary on the internet, and use a randomly selected word from that as the answer.
8. Create a visualization for the game using the Turtle library.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started