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

Keep track of words tweeted and choose random word at the end of the day #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ShubhamJain7
Copy link

Current state of code is for testing purposes. Commented lines need to be un-commented and a few other lines need to be removed for proper functionality

Copy link
Owner

@prajwalgatti prajwalgatti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. needs final touches.

elif word_count == no_of_words_per_day:
print('\ntodays_words:',todays_words)
question = list(random.choice(todays_words))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could by default make word a list type, instead of a tuple

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two elements of the tuple (tweet_id and answer) are always needed together so it makes sense to combine them in a tuple. Also, a list would be useful in cases where there is a possibility of adding more elements. That isn't the case here.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but since you're converting it back to a list type later on, might as well have it as a list in the first place. just for cleaner code that's all

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove redundant lines and comments, and test the code. I'll merge the PR.

tweet_bot.py Show resolved Hide resolved
@prajwalgatti prajwalgatti added the enhancement New feature or request label Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants