The first function is to produce a factorial using a for-loop. I included a 'stopifnot' prior to running the loop to prevent an infinite loop from occuring in the case of entry of a negative number.
#Python Program for #factorial of a number. Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is 720.
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this ...
Day4: Crafting a LinkedIn post "Excited to share my code for calculating the factorial of a number! In programming, the factorial of a non-negative integer is the product of all positive integers less ...