Python Question (write programs - 2)

FratBro23
Category:
Computer Science
Price: $5 USD

Question description

Requirement:

1. You cannot import any module

2. The programs must be solved by Recursion 


Question 1: Write a program called words.py that displays all the possible words that can be created from the given letters.

  1. Your program should first ask the user for the name of the file that contains all the possible

    words

    1. There will be one word on each line of the file

    2. All of the words in the file are lower case

  2. Next your program should ask the user for the letters. The letters will be given on 1 line with a space between each character.

  3. Your program should then display all of the possible words that can be created using those letters.

       1. Each letter can only be used one time

           1. For example if the letters input were: a p, then app would not be a valid word because it used p twice even though there was only 1 p entered. In order for app to be a valid word the user would have to at least enter 'a p p' as input. 

       2. The results should be displayed in alphabetical order 

       3. Each word should only be displayed one time. 

       4. Example

Enter the name of the file containing all of the words: english.txt
Please enter your letters separated by a space: c a t b 

ab 
abc 
abt 
ac 
act 
at 
bat 
ca 
cab 
cat 
ct
tab 


Enter the name of the file containing all of the words: english.txt 
Please enter your letters separated by a space: u u b t c s 
bus
bust 
but 
buts 
cs 
cst 
ct 
cts 
cub 
cubs 
cut 
cuts 
sc 
scut 
st 
stub 
sub 
tbs 
tub 
tubs 
us 
ut 


Please download the words.zip

Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1830 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors