Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

factorial sequence code in python with while loops

num = int(input("enter a number: "))
 
fac = 1
i = 1
 
while i <= num:
fac = fac * i
i = i + 1
 
print("factorial of ", num, " is ", fac)
Comment

PREVIOUS NEXT
Code Example
Python :: pyspark date to week number 
Python :: make a list from 0 to n python 
Python :: clear terminal in python 
Python :: correlation plot python seaborn 
Python :: split array into chunks python 
Python :: how to split and keep delimiter at the same line in python 
Python :: python exception element not found 
Python :: python regex replace all non alphanumeric characters 
Python :: python windows hide files 
Python :: Cannot convert non-finite values (NA or inf) to integer 
Python :: python find the key with max value 
Python :: install python on ubuntu 
Python :: standardscaler into df data frame pandas 
Python :: python number of cpus 
Python :: installing django 
Python :: create a directory python 
Python :: dataframe get list of index vlaues 
Python :: change size of selenium window 
Python :: python get list of all open windows 
Python :: images from opencv displayed in blue 
Python :: save and load catboost model 
Python :: pandas reset row indices 
Python :: python file size 
Python :: discord.py intents 
Python :: python virtual environment 
Python :: display Max rows in a pandas dataframe 
Python :: comment dériver une classe python 
Python :: throw error python 
Python :: pip vs anaconda venv 
Python :: python randomise between 0 or 1 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =