Python Forum
Computer science can you help me with the last part of the code after mentionedWords.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Computer science can you help me with the last part of the code after mentionedWords.
#10
@perfringo

https://ww3.hunter.cuny.edu/screencasts/...?video=5.5

Okay he told me to remove the last line from that video and You will need to replace that line with a loop that goes through the 3 most frequently mentioned usernames and prints the username followed by its count. Which I think is the above code I need to edit and change to match my other code? but I forgot what to input bc looking at it for so long got me lost.

I think I understand your first question :
You are given a collection of text files, each containing 1000 recent tweets posted by several popular Twitter accounts. Each line in a file is one tweet, so if we read the files the usual way, each line will corresponds to a separate tweet:

with open('nytimes.tweets') as lines:
for line in lines:
print(line)

but we don't want to open 12 files one by one instead we go through filename for @ and mention the top 3 most mentioned
Reply


Messages In This Thread
RE: Computer science can you help me with the last part of the code after mentionedWords. - by shirleylam852 - Nov-28-2020, 01:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Having trouble with my Computer Science task Dunxx 1 1,869 Oct-07-2021, 12:32 PM
Last Post: DeaD_EyE
  computer science coursework, read the text please and tell me if theres any specifics sixcray 4 2,756 Nov-11-2020, 03:17 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020