Skip to content

Conversation

SamratBarai
Copy link
Contributor

@SamratBarai SamratBarai commented Jan 8, 2025

Description

Added a new snippet for calculating factorials of a number

Type of Change

  • ✨ New snippet
  • πŸ›  Improvement to an existing snippet
  • 🐞 Bug fix
  • πŸ“– Documentation update
  • πŸ”§ Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

Closes #

Additional Context

Screenshots (Optional)

Click to view screenshots

@SamratBarai SamratBarai changed the title Calculating the factorial of a number Added Python factorial calculating snippet Jan 8, 2025
Copy link
Collaborator

@Mathys-Gasnier Mathys-Gasnier left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the contribution, could you please also merge main to your branch, making sure /public/consolidated doesn't exist ?


# Usage:
print(factorial(4)) # Returns 24
print(factorial(-4)) # Returns type error for invalid inputs
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO I don't think it's needed to showcase the errors

title: Calculate Factiorial of a number
description: Calculates factorial of a given number using recursive function
author: SamratBarai
tags: python,math,factorial,recursive-function
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please read the CONTRIBUTING.md file before adding snippets. Tags shouldn't contain the name of the language they are written in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello, calculate-compound-interest.md also has this tag

Copy link
Contributor Author

@SamratBarai SamratBarai left a comment

Choose a reason for hiding this comment

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

Removed unneccesary tags

@SamratBarai SamratBarai closed this Jan 9, 2025
@SamratBarai SamratBarai reopened this Jan 9, 2025
@SamratBarai SamratBarai marked this pull request as draft January 9, 2025 07:39
@SamratBarai SamratBarai closed this Jan 9, 2025
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.

3 participants