my python works

1)MULTIPLYING TWO ARBITRARY BIG INTEGERS BY PYTHON
$$———————–$$
def phi(i,array):
array[i+1]=int(array[i+1])+int(int(array[i])/10)
array[i]=int(array[i])%10
return array

#In this method I heavily use polynomial product and correcting the order. Any two integer can be multiplied in this program.
#Only one function was enough to proceed, phi(i,array). This function goes to the input index of given array and changes its value to the number remainder when divided by 10 and changes next index to + the previous number/10, i.e., we make first school division.

n1=input(“Enter First Integer : “)
n2=input(“Enter Second Integer: “)
a=[]
b=[]
for x in range(len(n1)):
a.append(n1[x])
for y in range (len(n2)):
b.append(n2[y])

a=a[::-1]
b=b[::-1]

s=[]
for x in range(len(a)+len(b)-1):
s.append(0)

for k in range (len(a)):
for l in range (len(b)):
s[k+l]=s[k+l]+int(a[k])*int(b[l])

for x in range (len(a)+len(b)-2):
phi(x,s)

s=s[::-1]

print(“Multiplication of “,n1,” and “,n2 ,”is :”,end=””)
f=1
for i in s:
print(i, end=””)
$$———————–$$

2)SORTING CODE BY PYTHON
$$———————–$$

def phi1(array):
s=array[0]
for x in range (len(array)):
if(array[x]<s):
s=array[x]
return s

def phi2(arr1,arr2,s):
fix=len(arr1)
x=0
while(x<fix):
if(s==arr1[x]):
arr2.append(s)
del arr1[x]
fix=fix-1
x=x+1
return arr2,arr1

def filetoarray(filee):
U=open(filee,”r”)
y=[]
for line in U:
a=line.split()
y.append(float(a[0]))
U.close()
return y

#MAIN
filee=input(“Write the data name and press ‘ENTER’: “)

y=filetoarray(filee)

print(y)
print(“Testing with sorted function:\n”,sorted(y))

s=[]
fix2=len(y)
while(len(s)<fix2):
phi2(y,s,phi1(y))
print(“My result:\n”,s)

file = open(“sorted-result.txt”,”w”)
for x in range (len(s)):
file.write(str(s[x])+”\n”)

file.close()
$$———————–$$

3)SIMPSON INTEGRATION BY PYTHON
$$———————–$$

import math

def filetoarray():
U=open(“S11.dat”,”r”)
y=[]
for line in U:
a=line.split()
y.append(float(a[0]))
U.close()
return y

def valuesofF(array,f):
F=[]
for i in range(len(array)):
F.append(f(array[i]))
return F

def simpsons(array,k):
F=k
U=F[0]+F[len(array)-1]
for x in range(1,len(array)-1):
if(x%2):
U=U+4*F[x]
continue
U=U+2*F[x]
U=U/3*(array[len(array)-1]-array[0])/(len(F)-1)
return U

def functionstutoirals():
for x in range(len(“FUNCTION TUTOIRAL:”)):
print(“-“, end=””)
print(“\nFUNCTION TUTOIRAL:”)
for x in range(len(“FUNCTION TUTOIRAL:”)):
print(“-“, end=””)
print(“\nmath.sin(x)\nReturn the sine of x (measured in radians)\n”)
print(“math.sqrt(x)\nReturn the square root of x\n”)
print(“math.erf(x)\nError function at x.\n”)
print(“math.exp(x)\nReturn e raised to the power of x.\n”)
print(“math.log(x[, base])\nReturn the logarithm of x to the given base.If the base not specified, returns the natural logarithm (base e)of x. \n”)
print(“math.gamma(x)\nGamma function at x.\n”)
for x in range(len(“DATA:”)):
print(“-“, end=””)
print(“\nDATA:”)
for x in range(len(“DATA:”)):
print(“-“, end=””)
print(“\nmath.e = 2.718281828459045\nmath.inf = inf\nmath.nan = nan\nmath.pi = 3.141592653589793…\nmath.tau = 6.283185307179586\n”)

functionstutoirals()
y=filetoarray()
FF=eval(input(“Enter the function according to tutorial above: “))
j=valuesofF(y,FF)
print(“\n”,simpsons(y,j))