Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python need answer 1: Write a function uniqueWords () that takes a list of sentences (strings). You will return a list of unique words found

python need answer
image text in transcribed
image text in transcribed
1: Write a function uniqueWords () that takes a list of sentences (strings). You will return a list of unique words found across all the sentences. Case needs to be ignored. The following shows several sample runs of the function:
2: Write a function hasLetters() takes a list of strings and letters as parameter. Returns a True if any of the words in the list contain the letters. False if it doesnt. The following shows several sample runs of the function:
3: Write a function replacer() that takes a list of sentences, and two strings. The wo strings represent the word to find and the word to replace it with. You will return a list of new sentences. The following shows several sample runs of the function:
4: Implement a function numberLogger. The function will ask the user to enter a series of numbers separated by a comma. The function will check each number and append every number that is greater than or equal to the second parameter to the file.. You must catch errors that occur when opening the file. The following shows what the results of several runs of the function on one file :
5: Write a function counter that reads data from a file and return a count of how many values in the file are equal to the second parameter. Each value is on its own line in the file and you can assume its an integer. You must catch errors that occur when working with the file.
fourth assignment section. You should save the template file provided and then modify that file by adding the bodies for the functions. When you do, make sure to remove the placeholder pass statements that are currently there. You must also write doc strings for every function. A submission without doc strings will not earn full credit. 1. Write a function unique Words that takes a list of sentences (strings). You will return a list of unique words found across all the sentences. Case needs to be ignored. The following shows several sample runs of the function: >>> uniqueWords (t'this is a test', 'not too hard a problem', 'could be on a test, i like the word test)) t'this', 'is', 'a', 'test', 'not', 'to, 'hard', 'problem, 'could', 'be', 'on '1', 'like', 'the', 'word'] >>> unique words (1) >>> uniquewords (Can you see', 'See you can, "You can see']) 'can' you', 'see'] 2. Write a function hasLetters) takes a list of strings and letters as parameter. Returns a True if any of the words in the list contain the letters. False if it doesn't. The following shows several sample runs of the function: >>> hasLetters (['final', 'best', 'word', 'find' ], 'in') True >>> hasLetters ('final', 'best', 'word', 'find' ], 'zzz') False >>> hasLetters ([], 'a') False >>> hasLetters (I' Zoko', 'Anthony', 'test'], '20') . True 8:22 ALTE Assignment 4 1of 5 TN tnaimai 1 Per te lateste 2.3.4.5.6.7. Pese armed by: 05 50 297) E

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

5. A review of the key behaviors is included.

Answered: 1 week ago