1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ksivusya [100]
3 years ago
9

The file includes 4993 tweets including the keyword 'election'. Each tweet is represented in a separate line. Write a program to

open the file and read through its lines, then only if a tweet includes a hashtag (a term beginning by the
Computers and Technology
1 answer:
Likurg_2 [28]3 years ago
7 0

Answer:

import re

with open("../../Downloads/Tweets.txt","r", encoding="utf-8") as tweets:

   myfile = tweets.readlines()

   for item in myfile:

       item = item.rstrip()

       mylist = re.findall("^RT (.*) ", item)

       if len(mylist) !=0:

           for line in mylist:

               if line.count("#") >=1:

                   ln = line.split("#")

                   dm = ln[1]

                   print(f"#{dm}")

Explanation:

The python source code filters the document file "Tweets" to return all tweets with a hashtag flag, discarding the rest.

You might be interested in
Why when you are on wifi it keeps kicking you off is your class during online learning​
Leviafan [203]
Sometimes, it lags on the other side or from the teachers computer so the app just kicks people out sometimes, it’s sucks I know
7 0
3 years ago
Read 2 more answers
An important piece of a project is past due date.
bixtya [17]
Budget and time is the answer
4 0
3 years ago
Read 2 more answers
Ns.office.com/Pages/ResponsePage.aspx?id=bd8
bulgar [2K]

Answer:

spreadsheet software

Explanation:

Spreadsheet software is an application that allows users to organize data in columns and rows and perform calculations on the data. These columns and rows collectively are called a worksheet.

6 0
3 years ago
Read 2 more answers
B =(-21) (0) + (-50) ÷ (-5)​
Irina-Kira [14]

Answer:

B=10

Explanation:

(-21) x 0=0 and (-50)÷(-5)=10

0+10=10

8 0
2 years ago
What is a computer attack where an attacker accesses a wireless computer network, intercepts data, uses network services, and/or
Harman [31]

Answer:

The correct answer to the following question is Drive-by hacking .

Explanation:

Drive-by hacking is the type of hacking which comes under the cyberterrorism.

Drive-by hacking is the hacking where the hackers can access their data and steal their data, use their network services from some "safe" distance without going inside the company or an organization.

Drive-by download is the type of download of the malicious code into your mobile devices or the computers which occur by designed and it leave you to the cyberattack.

7 0
3 years ago
Other questions:
  • Please explain external hashing, B-trees, and traversals. 3-5 sentences per
    8·1 answer
  • When does the VB.NET programming environment start to operate?
    10·1 answer
  • Fundamental types of data, such as strings, integers, and real numbers, are known as
    5·1 answer
  • How can our perceptions help us to choose the channel for our message?
    5·1 answer
  • Which do switches create?<br> Networks<br> Wireless access points<br> Routes<br> Collision domains
    13·1 answer
  • You want to substitute one word with another throughout your document. What tool(s) should you use?
    9·1 answer
  • Which steps are correct for creating a document from a user-defined template?
    15·1 answer
  • Cual
    5·1 answer
  • Quick I need help ASAP
    7·2 answers
  • oe, a user, receives an email from a popular video streaming website. the email urges him to renew his membership. the message a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!