Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 22, 2020 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/d8bff02156ad3f6373e85b4351e6694f to your computer and use it in GitHub Desktop.
Save amankharwal/d8bff02156ad3f6373e85b4351e6694f to your computer and use it in GitHub Desktop.
def factorial(n) -> object:
return 1 if (n==1 or n==0) else n * factorial(n-1)
n= int(input("enter number"))
print(factorial(n))
def greatest(x,y,z):
if (x>y)and(x>z):
print(x,"is greatest")
elif (y>x)and (y>z):
print(y,"is greatest")
else:
print(z,"is greatest")
def addtwo(x,y):
return x+y
def subtracttwo(x,y):
return x-y
def multiplytwo(x,y):
return x*y
def dividetwo(x,y):
return x/y
def square(x):
return (x*x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment