Week 3
Week 3
x=int(input('enter x value:'))
y=int(input('enter y value:'))
z=int(input('enter z value:'))
sum = x + y + z
if x == y == z:
sum = sum * 3
print('sum=',sum)
import math
n=int(input('enter any number:'))
print('factorial of given number is:')
print(math.factorial(n))
factorial = 1
if num < 0:
print("Sorry, factorial does not exist for negative numbers")
elif num == 0:
print("The factorial of 0 is 1")
else:
for i in range(1,num + 1):
factorial = factorial*i
print("The factorial of",num,"is",factorial)
a=int(input('enter a value:'))
b=int(input('enter b value:'))
c=int(input('enter c value:'))
if ((a >= b) and (a >= c)):
largest = a