Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

iN PYTHON PLEAS scrabbleWords (myLetters) NO return (just calls the helper functions above). Here you will call upon your helper functions created in steps 1-4

image text in transcribed iN PYTHON PLEAS

scrabbleWords (myLetters) NO return (just calls the helper functions above). Here you will call upon your "helper functions" created in steps 1-4 to form a list of all the words (from wordlist.txt) that can be formed from the set of letters contained in myLetters: Create a Python list of strings containing the words from wordlist.txt. You will want to call helper function createwordList() Create a list of all the words that we can make with myLetters by looping through every word in wordList and checking if it can be made with myLetters. You will want to call helper function canweMakelt() Create a dictionary of letter: pointValue pairs name it letterPoints. The image below shows the Scrabble point value for each letter, but note that your dictionary keys should be the lower case letters. Any character that is not shown in this image has a point value of 0. You don't have to add 0 point keys to your dictionary, rather make sure that your getwordPoints uses a point value of O if a letter is not in the provided dictionary A, B, C, D, E, F. G H J, K, L, M, N, O, P Q R, S, T U V. W X,Y,Z, .Create a list of tuples consisting of (pointValue, word) pairs by looping through the list myWords and getting the point value for each word-name this list of tuples pointwordList. To calculate pointValue, you will want to call helper function getWordPoints(). Note that each tuple is ordered as (pointValue word) and not (word, pointValue). This makes it easier to sort the list (see next step) Sort pointwordList in descending order. Now, you can use the list method sort() to sort the tuples according to their first entry, pointValue. But sort0 arranges a list in ascending order by default....can you think of a way to reverse this? Call your outputwordPointPairs() and print your formatted string output to terminal. Then make a second call to outputwordPointPairs)to output to a text file named after the string in myLetters scrabbleWords (myLetters) NO return (just calls the helper functions above). Here you will call upon your "helper functions" created in steps 1-4 to form a list of all the words (from wordlist.txt) that can be formed from the set of letters contained in myLetters: Create a Python list of strings containing the words from wordlist.txt. You will want to call helper function createwordList() Create a list of all the words that we can make with myLetters by looping through every word in wordList and checking if it can be made with myLetters. You will want to call helper function canweMakelt() Create a dictionary of letter: pointValue pairs name it letterPoints. The image below shows the Scrabble point value for each letter, but note that your dictionary keys should be the lower case letters. Any character that is not shown in this image has a point value of 0. You don't have to add 0 point keys to your dictionary, rather make sure that your getwordPoints uses a point value of O if a letter is not in the provided dictionary A, B, C, D, E, F. G H J, K, L, M, N, O, P Q R, S, T U V. W X,Y,Z, .Create a list of tuples consisting of (pointValue, word) pairs by looping through the list myWords and getting the point value for each word-name this list of tuples pointwordList. To calculate pointValue, you will want to call helper function getWordPoints(). Note that each tuple is ordered as (pointValue word) and not (word, pointValue). This makes it easier to sort the list (see next step) Sort pointwordList in descending order. Now, you can use the list method sort() to sort the tuples according to their first entry, pointValue. But sort0 arranges a list in ascending order by default....can you think of a way to reverse this? Call your outputwordPointPairs() and print your formatted string output to terminal. Then make a second call to outputwordPointPairs)to output to a text file named after the string in myLetters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning PostgreSQL On The Cloud Simplifying Database As A Service On Cloud Platforms

Authors: Baji Shaik ,Avinash Vallarapu

1st Edition

1484234464, 978-1484234464

More Books

Students also viewed these Databases questions