#---------------------------- finding Sum and Product of n numbers --------------------------
nums =[] #initializing empty list to get elements
n1 = int(input("Enter the no.of elements : ")) # no. of elements
add =0
mul =1
for i in range(n1):
print(i+1,"Enter number :",end='')
ele =int(input())
nums.append(ele)
add += nums[i] # adding all element in list
mul *= nums[i] # multiplying all element in list
print("The sum is : ",add)
print("The product is : ",mul)
#---------------------------- finding Sum and Difference numbers -----------------------------
n1 = eval(input("Enter 1st number :"))
n2 = eval(input("Enter 2nd number :"))
n3 = eval(input("Enter 3rd number :"))
n4 = eval(input("Enter 4th number :"))
add= (n1+n2),(n3+n4)
sub =(n1-n2), (n3-n4)
print("\nSum : (",n1,"+",n2,",",n3,"+",n4,") =",add) #print("Sum : ",add)
print("\nDifference : (",n1,"-",n2,",",n3,"-",n4,") =",sub) # print("difference :",sub)
#---------------------------- finding positive, negative of numbers -------------------------
n1 = int(input("Enter 1st number :"))
n2 = int(input("Enter 2nd number :"))
if(n1 == 0 & n2 ==0 ): # checking for zeros
print("All are zero.")
if(n1 == n2 & n2==n1): # checking for equality
print("All are Equal")
# Checking for negative
if(n1<0 or n2<0 ):
if(n2<0 ):
print("2nd number",n2,"is negative")
if(n1<0 ):
print("1st number",n1,"is negative")
else:
print()
# Checking for positive
if(n1>0 and n2>0 ):
print("All are postive")
if(n1>0 or n2>0 ): # Checking for positive
if(n1>0 ):
print("1st number",n1,"is Positive")
if(n2>0 ):
print("2nd number",n2,"is Positive")
#---------------------------- n numbers of elements --------------------------------------
n =int(input("Enter the no.of numbers :"))
for i in range(1,n+1):
print(i,end=' ')
#---------------------------- count numbers of elements of given range------------------------
sn =int(input("Enter the start number :"))
en =int(input("Enter the end number :"))
count =0
for i in range(sn,en+1): # range from start to end+1
print(i,end=' ')
count+=1
print("\nNo. of element : ",count)
#---------------------------- check whether given number can form triangle -------------------
num = int(input("Enter a number :"))
p=0
i=1
while(num>=p):
if(num==p):
print("\ncan form Triangle" )
p+=i
i+=1