Find Jobs
Hire Freelancers

Small Python Project 5

$10-30 USD

Đã hoàn thành
Đã đăng vào hơn 5 năm trước

$10-30 USD

Thanh toán khi bàn giao
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
Mã dự án: 18255371

Về dự án

4 đề xuất
Dự án từ xa
Hoạt động 5 năm trước

Bạn muốn kiếm tiền?

Lợi ích khi chào giá trên Freelancer

Thiết lập ngân sách và thời gian
Nhận thanh toán cho công việc
Phác thảo đề xuất của bạn
Miễn phí đăng ký và cháo giá cho công việc
Đã trao cho:
Avatar người dùng
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 trong 1 ngày
5,0 (16 nhận xét)
3,9
3,9
4 freelancer chào giá trung bình $31 USD cho công việc này
Avatar người dùng
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 trong 1 ngày
4,5 (13 nhận xét)
4,5
4,5
Avatar người dùng
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 trong 1 ngày
5,0 (1 nhận xét)
1,4
1,4

Về khách hàng

Cờ của UNITED STATES
Austin, United States
5,0
3
Phương thức thanh toán đã xác thực
Thành viên từ thg 9 17, 2018

Xác thực khách hàng

Cảm ơn bạn! Chúng tôi đã gửi email chứa đường link để bạn lấy tín dụng miễn phí.
Đã xảy ra lỗi trong khi gửi email của bạn. Hãy thử lại.
Người Dùng Đã Đăng Ký Tổng Số Việc Đã Đăng
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Đang tải xem trước
Đã cấp quyền truy cập vị trí.
Phiên đăng nhập của bạn đã hết hạn và bạn đã bị đăng xuất. Hãy đăng nhập lại.