Question: write python code : You have an if ( line [ 0 : 3 ] = = URL ) to check if the line is
write python code : You have an ifline:URL to check if the line is a URL
Under the if statement, add an else: statement
The else will be for all the words that arent the URL line
The else statement is still inside of the for line in file:
Inside the else statement:
Use line.split to split each line of the file and store it into a variable
called words
Since words is a list of words, we can do for word in words:
word will become every single word
printword
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
