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]
2 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]2 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
What kind of device is a cpu input or output?
Rina8888 [55]
Correct answer: Neither

The CPU<span> is also known as the </span>processor<span> or microprocessor. The </span>CPU<span> is responsible for executing a sequence of stored instructions called a program. This program will take </span>inputs<span> from an </span>input<span> device, process the </span>input<span> in some way and </span>output<span> the results to an </span>output<span> device.</span> It is neither an input nor an output device, but it is usually connected to both kinds of devices.

Output devices like your monitor, speaker, and printer does not process anything fo it to be categorized as a processing device like your CPU and so as input devices like your mouse, microphone, and keyboard.

3 0
3 years ago
A smartphone user notices that their phone gets very hot, and their battery is draining quickly. Even when the phone is in their
nika2105 [10]

Answer:

The problem would be the battery

Explanation:

The reason is becuse the battery might be bad or have a shortage in it hope this helps :) and good luck!

6 0
2 years ago
To create a multiple-table form based on the âmanyâ table, tap or click the ____ button on the create tab to create a form in la
Archy [21]
Click on the blank form button. 
3 0
3 years ago
Gaven's instructor told him to include a personal statement in his work portfolio. Why did his instructor recommend including a
KatRina [158]
The recommendation of the instructor for Gaven to include a personal statement in his work portfolio will allow him to identify his career goals. If he is unable to show this to his work portfolio then he may simply state it in the personal statement. Thus, the answer to this item is letter A. 
6 0
3 years ago
After a hard rain, water flows faster in a local creek. This washes away a lot of sediment, making the creek a little deeper.
notka56 [123]
B. The Grand Canyon 
Got this of a Study Island test.  Good Luck!
6 0
3 years ago
Other questions:
  • OSHA requires that employers pay for most required personal protective equipment (PPE), including: A. Hard hats B. Logging boots
    5·1 answer
  • When a server crashes and goes offline on a network, which of the following helps to determine that the server is unavailable?
    9·1 answer
  • You would set a ___________ to prevent users from immediately changing their password several times in one day to return to the
    15·2 answers
  • Do you think I could create a working animatronic like the one from five nights at freddys
    12·2 answers
  • Netflix shows to watch?
    11·2 answers
  • Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and
    11·1 answer
  • Discuss briefly four types of websites and the criteria you will use to evaluate the content of a website
    8·1 answer
  • 13. Place where names, addresses and email information<br> is stored
    6·1 answer
  • How is primary storage different from secondary storage? Select the TWO correct statements. The CPU can only read and write data
    12·2 answers
  • What is a good theme statement for the short Pixar film "bao"?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!