Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help please Edit Selection View Go Debug Terminal Help Untitled-1-Visual Studio Code Untitled-1 # 1, Write a block of code that opens the file getty
Help please
Edit Selection View Go Debug Terminal Help Untitled-1-Visual Studio Code Untitled-1 # 1, Write a block of code that opens the file getty . txt for "read" and prints the number of lines in the file 28 # HINT: is there a way to read the lines in and count them? 30 31 line at a time? all at once? 36 37 39 #2. write a block of code that opens the file getty. txt for 40 41 # -read" and prints the number of four-letter words in the 42 43 # file. 45 HINT: should be able to do this lickitey-splito... 46 47 48 49 50 s1 #3. wite a block of code that reads nums.txt and then provides 52 53 both the sum and the average of the numbers. 54 55 56 57 # HINT: don't forget that these will be read in as strings and will thus need converting n 372 32-bit 00A O Type here to search ovo # HINT: don't forget that these will be read in as strings and will thus need converting 60 61 62 63 64 65 #4. Write a block of code that asks the user for a filename. Then 67 open that file in "append" mode and write YOUR first and last 68 69 # name to the file on two separate lines. 7e 71 72 73 74 75 76 77 78 #5. Write a block of code that should prompt the user for the # names of two text files. The contents of the first file 79 80 81 # 82 83 84 85 86 should be read and written to the second file. n 3.7.2 32-bit 0OAO O Type here to search ovo eIT LU LHe second file #6. Write a block of code that prompts the user for the names of two text files and compare the contents of the two files to see if they are the same. If they are, it should output 5"YES". If they are not, it should output "NO" 3 4. # 6 8 99 # Use a loop to read and compare the files one line at a time. a0 01 # The loop should . break. as soon as a pair of different lines 02 03 # if found. 04 05 # 06 07 08 # HINT: This is a GREAT place to use that -else" clause for loops. 110 112 113 2 32-bit O0A0 Type here to search Untitled-1 #7. The payroll department keeps a list of employee information # for each pay period in a text file called pay.txt. The format # for each line in the file is comma separated, as follows: 120 121 # 122 123 #Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started