Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

from __future__ import print_function ''' Week Two Assignment 1 - File Processing ''' ''' Complete the script below to do the following: 1) Add your

from __future__ import print_function

''' Week Two Assignment 1 - File Processing '''

''' Complete the script below to do the following: 1) Add your name, date, assignment number to the top of this script 2) Open the file redhat.txt a) Iterate through each line of the file b) Split eachline into individual fields (hint str.split() method) c) Examine each field of the resulting field list d) If the word "worm" appears in the field then add the worm name to the set of worms e) Once you have processed all the lines in the file sort the set iterate through the set of worm names print each unqiue worm name 3) Submit NamingConvention: lastNameFirstInitial_Assignment_.ext for example: NAME_WK2-1_script.py NAME_WK2-2_screenshot.jpg A) Screenshot of the results in WingIDE B) Your Script '''

import os

SCRIPT_NAME = 'ASSIGNMENT NAME' SCRIPT_VERSION = 'VERSION #' SCRIPT_AUTHOR = 'MY NAME' SCRIPT_DATE = 'DATE'

uniqueWorms = set()

with open("redhat.txt", 'r') as logFile: for eachLine in logFile: ''' your code starts here '''

str = eachLine.split() print(str)

I am very confused on what to do next. I am on step C and I am stuck. Any help would be very helpful. Python

I don't need that file exactly just an idea of the code so I have an idea

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions

Question

What are the IF / ID , ID / EX

Answered: 1 week ago

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago