Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in each of the following language: Python Your program will consist of a function that accepts two strings. Each string is the

Write a program in each of the following language: Python

Your program will consist of a function that accepts two strings. Each string is the name of a le. The rst is the name of an input le and the second is the name of an output le. Name the function hw1. (Note that your program can also make use of other helper functions. Just make sure function hw1 takes as arguments the input le and output le that are speci ed in the program) A pangram is a sentence that contains all the letters of the English alphabet at least once. For example, the quick brown fox jumps over the lazy dog is a pangram. The program you are to write must read in an input le (input.txt - a plain text le which contains 5 sentences), line by line and check if the line read is a pangram or not. If the sentence read is a pangram, it writes true to the output le. If it is not, it writes false to the output le. For example, if input.txt contains: we promptly judged antique ivory buckles for the next prize. how quickly daft jumping zebras vex. pottery is an art. crazy fredrick bought many very exquisite opal jewels. mr. dumbledore is a funny name for a dog. Then your program must output the following to the output.txt: true true false true false NOTE: Output is case sensitive { please use all lower case in the output le. The example provided here is formatted for human readability. Please look at the sample input output les to see the precise formatting.

Python Speci c Instructions Your code should be written in hw1.py. Create a hw1 function that takes in two strings as argu- ments: the rst for the name of input le and second for the name of output le. Skeleton Code: def hw1(input, output): # read input le line by line # for every line in input le, check if it contains all alphabets # store result (true/false) in a variable # write result to output file

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

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

Students also viewed these Databases questions