python programmibg code example

Example 1: python

Python is an interpreted,
high-level and general-purpose
programming language.
Created by Guido van Rossum
and first released in 1991, Python's
design philosophy emphasizes code
readability with its notable use of
significant whitespace. Wikipedia

Example 2: python

n = int(input('Type a number, and its factorial will be printed: '))

if n < 0:
    raise ValueError('You must enter a non negative integer')

fact = 1

for i in range(2, n + 1):
    fact *= i

print(fact)

Tags:

Misc Example