edX MIT 6.00.1x 2020 Introduction to Computer Science and Programming Using Python
Week 3: Structured Types: Problem Set 3 Problem 1 Solution
Problem 1 - Is the Word Guessed
Please read the Hangman Introduction before starting this problem. We'll start by writing 3 simple functions that will help us easily code the Hangman problem. First, implement the function isWordGuessed that takes in two parameters - a string, secretWord, and a list of letters, lettersGuessed. This function returns a boolean - True if secretWord has been guessed (ie, all the letters of secretWord are in lettersGuessed) and False otherwise.
Example Usage:
secretWord = 'apple'
lettersGuessed = ['e', 'i', 'k', 'p', 'r', 's']
print(isWordGuessed(secretWord, lettersGuessed))
False
For this function, you may assume that all the letters in secretWord and lettersGuessed are lowercase.
Step by step process. Practice by writing the code yourself.
MIT 6.00.1x 2020 Introduction to Computer Science and Programming Using Python
• MIT 6.00.1x 2020 Introduction to Comp...
Chapter 2 Python Revision Tour 2, Grade 12 CS (083) CBSE Solutions Sumita Arora 2020-21
• Chapter 2 Python Revision Tour II Gra...
Chapter 1 Python Revision Tour Grade 12 CS (083) CBSE Solutions Sumita Arora 2020-21
• Chapter 1 Python Revision Tour Grade ...
Python Tutorial For Beginners
• Python Tutorial for Beginners
#Python #MIT #edX #6.00.1x #2020 #Solutions #Week3 #Structured #Types #ProblemSet3 #Problem1 #Answers #Introduction #ComputerScience #CS #Programming #Computer #Science #CS #IT #AI #ICT #Code #Practice #Online #Coding #Classes #Python3.9 #Beginners