#__________________________cheyab.ir__________________________ #__________________________functions__________________________ def sum( a , b ): #sum result = a + b ; print ( a , " + " , b , " = " , result ); return ; def sub( a , b ): #sub result = a - b ; print ( a , " - " , b , " = " , result ); return ; def print_ascending( x ): #print ascending y = x ; i = 0 ; for var in y : j = 0 ; for var in y : if (y[i] < y[j]): temp = y[i]; y[i] = y[j]; y[j] = temp; j=j+1; i = i+1; print (y); return ; def even( x ): # 3 even or not count = i = 0; for var in x: if ((x[i] % 2) == 0 ): count = count + 1 ; i=i+1; if (count >= 3): return 1; #if 3 even are in x return 0; #__________________________cheyab.ir_____________________ #__________________________main__________________________ x=[0,0,0,0,0]; x[0] = int(input(" \n enter number 1 :")) ; x[1] = int(input(" \n enter number 2 :")) ; x[2] = int(input(" \n enter number 3 :")) ; x[3] = int(input(" \n enter number 4 :")) ; x[4] = int(input(" \n enter number 5 :")) ; max1 = 0 ; max2 = 0 ; i=0; for value in x : if ( max1 < x[i] ): max1 = x[i] ; i=i+1; i=0; for value in x : if ( max2 < x[i] and x[i] < max1 ): max2 = x[i]; i=i+1; min = x[0]; i=0; for value in x : if (min > x[i]): min = x[i]; i=i+1; sum ( max1 , max2 ); sub ( max1 , min ); print_ascending(x); c=even (x); if (c==1): print("\n there are 3 or above even in x"); sum ( max1 , 5 ); else: print("\n there are 2 or less even in x"); sum ( max1 , min ); #__________________________cheyab.ir__________________________ #__________________________End of code________________________