Find Jobs
Hire Freelancers

Small Python Project 5

$10-30 USD

I përfunduar
Postuar over 5 years ago

$10-30 USD

Paguhet në dorëzim
Summary: ----------- Your program will open a text file, read each line and count how many times each word appears in the file. Each word will be stored in a dictionary such that the key is the word and the value is the number of times the word appears in the file. Once all words have been counted, print the dictionary one element at a time as key-value pair using a for loop Details: -------- 1) Create a [login to view URL] file in your local workspace using the data given below 2) Write a program that opens the text file and reads each line. 3) Convert each line into a list of words. 4) For each word in the list, convert the word to lower case, remove any punctation and update a dictionary such that the word is the 'key' and the word count is the 'value'. 5) print the contents of the dictionary using a for loop such that each key-value pair is printed as below "The number of times ", <key>, "occurs in the dictionary is --> ", <value> 6) You must include exception handling around file operations or you will lose points. 7) You must comment any function definitions (if you choose to use function ) -- describe what the function does. If any parameters are passed, describe them. If anything is returned by the function, describe the return value. If you implement the entire program without any functions, you should comment in appropriate places as to what the block of code is doing Submit the proper comments. Example: ---------- "hello hello hello foo bar" would result in a dictionary: {"hello": 3, "foo" : 1, "bar" : 1} Hint: ----- The best way to convert a character string to a list of words is with the split() method. foo = "Computer science is fun and interesting." # bar is a list, such that each item # in the list is a word in the string foo # bar = [login to view URL]() print(bar) The output of the above code snippet: ['Computer', 'science', 'is', 'fun', 'and', 'interesting'] ----------------------------------------------------------------------------------- [login to view URL] ----------------------------------------------------------------------------------- All things bright and beautiful, All creatures great and small, All things wise and wonderful, The Lord God made them all
ID e Projektit: 18255371

Rreth projektit

4 propozime
Projekt në distancë
Aktive 5 yrs ago

Po kërkoni të fitoni para?

Përfitimet e ofertës për Freelancer

Vendosni buxhetin dhe afatin tuaj
Paguhuni për punën tuaj
Përshkruani propozimin tuaj
Është falas të regjistrohesh dhe të bësh oferta për punë
I dhënë për:
Avatari i Përdoruesit
Hello, read your description and pretty sure to complete these simple tasks. Your satisfaction by the quality of work is guaranteed. We can discuss further details in pm and can start working right away. Looking forward to hear back from you. kind regards,
$30 USD në 1 ditë
5,0 (16 përshtypje)
3,9
3,9
4 freelancers are bidding on average $31 USD for this job
Avatari i Përdoruesit
Dear sir, How are you? My work completion time is fastest and the price is very good. I am a PYTHON expert. I will ensure that all the data you want is accurate and fast. You will see through my profile that I have guaranteed great python work for many clients. I will wait for your good response. Thanks and Best regards! JinXueTian
$15 USD në 1 ditë
4,5 (13 përshtypje)
4,5
4,5
Avatari i Përdoruesit
I have experties in Python. I will be able to resolve your project as per your requirement. Please feel free to discuss. Regards
$30 USD në 1 ditë
5,0 (1 review)
1,4
1,4

Rreth klientit

Flamuri i UNITED STATES
Austin, United States
5,0
3
Mënyra e pagesës u verifikua
Anëtar që nga sht 17, 2018

Verifikimi i klientit

Faleminderit! Ne ju kemi dërguar me email një lidhje për të kërkuar kredinë tuaj falas.
Ndodhi një gabim gjatë dërgimit të email-it tuaj. Ju lutemi provoni përsëri.
Përdorues të regjistruar Punë të postuara
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Po ngarkohet shikimi paraprak
Leja u dha për Geolocation.
Seanca e hyrjes ka skaduar dhe ke dalë. Hyr sërish.