Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPTIMIZED CODE AND CREDENTIALS PROTECTED #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Aalian2241
Copy link

I have optimized the code by doing the following:

  1. Protected the Credentials by using env imports
  2. Used a 'with' statement when opening the file, to avoid the need to close it explicitly.
  3. Used list comprehensions to perform the sentiment analysis on the tweets.
  4. Used f-strings for string formatting, as they are more efficient.
  5. Used a Counter object from the collections module to count the number of tweets with each sentiment, instead of multiple if statements.

I'd really appreciate it if you accept my pull request even though its an years old repo.
Thanks

@Aalian2241 Aalian2241 changed the title optimized and safe code: Keys protected, file opening, f-strings, Cou… OPTIMIZED CODE AND CREDENTIALS PROTECTED Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant