Write a python program. Write a function called guess() that does the following 1. takes a character as input 2. prints the word (global variable) where only the character is revealed, and the other letters are replaced by underscores 3. returns true if the character is in the word and false otherwise

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 23PE
icon
Related questions
Question
Write a python program. Write a function called guess() that does the following
1. takes a character as input
2. prints the word (global variable) where only the character is revealed, and the other letters are replaced by underscores
3. returns true if the character is in the word and false otherwise
 
Example:
word = “koala”
guess(‘a’) prints __a_a and returns True
guess(‘b’)prints _____ and returns False
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning