Question: 1. Please write the follwoing Python 3 program. Also, please show all outputs. ________________________________________________________________________________ Beautiful Soup to be used for this program above (save as

1. Please write the follwoing Python 3 program. Also, please show all outputs.

1. Please write the follwoing Python 3 program. Also, please show all

________________________________________________________________________________

Beautiful Soup to be used for this program above (save as a txt file:

BEAUTIFUL Soup, so rich and green, Waiting in a hot tureen! Who for such dainties would not stoop? Soup of the evening, beautiful Soup! Soup of the evening, beautiful Soup!

Beau--ootiful Soo-oop! Beau--ootiful Soo-oop! Soo--oop of the e--e--evening, Beautiful, beautiful Soup!

Beautiful Soup! Who cares for fish, Game, or any other dish? Who would not give all else for two Pennyworth only of Beautiful Soup? Pennyworth only of beautiful Soup?

Beau--ootiful Soo-oop! Beau--ootiful Soo-oop! Soo--oop of the e--e--evening, Beautiful, beauti--FUL SOUP!

Program 1: file_stats. (10 pts) Write a program file stats.py that accepts a text file name as an argument and outputs the number of characters, words, lines, and the length (in characters) of the longest line in the file. Example python file stats.py beautiful soup by Lewis Carroll.txt Characters: 553 Words: 81 Lines: 21 Longest line: 38 The program should have a function stats that takes the filename as an input and returns the statistics as a tuple, so it can also be used this way: from file stats import stats >c, ,, stats ('beautiful soup by Lewis Carro.txt) print("c:, : l:0,l: .format(c, , U)) c: 553, : 81, : 21, : 38

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!