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

Added a python snippet to check if a number is an Armstrong number #2004

Closed
wants to merge 7 commits into from

Conversation

Pranav-AJ
Copy link

No description provided.

@github-actions github-actions bot added python Related to Python content. snippet Related to snippets. labels Sep 12, 2023
@Pranav-AJ Pranav-AJ closed this Sep 13, 2023
@Pranav-AJ Pranav-AJ reopened this Sep 13, 2023
```py
def is_armstrong(num):
copy = num
Sum = 0

Choose a reason for hiding this comment

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

Not mandatory, but I think it is better if you follow the same naming convention all over the Python snippet. All the other variables in the snippet start with smaller case letters, without "Sum". So, it will be better if you rename this variable "sum".

Copy link
Author

Choose a reason for hiding this comment

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

Hey, thanks for your feedback. But I used 'Sum' because 'sum' is an inbuilt function in python so it would be a bad practice even though it supports it. Maybe I should consider changing the variable name to total/result.

@Chalarangelo
Copy link
Owner

Thanks for contributing, but Armstrong number check has been brought up in the past and isn't really relevant to a lot of users, while also being trivial to compute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Related to Python content. snippet Related to snippets.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants