l1=[6,3,4,7,8,8,1,5,6,2]
ll1=len(l1)
l2=[]
for i in range(ll1):
j=0
popindex=0
minl=l1[0]
for j in range(0,len(l1)):
if l1[j]<minl or l1[j]==minl:
minl=l1[j]
popindex=j
l1.pop(popindex)
l2.append(minl)
l2
l1=[6,3,4,7,8,8,5,6]
minl=l1[0]
print(minl)
def matrixForm_chek(a):
x=True
for i in range(len(a)-1):
if len(a[i])!=len(a[i+1]):
x=False
return x
def twoMatrix_check(a,b):
if len(a[0])==len(b):
return True
else:
return False
def check_matrix(a,b):
if matrixForm_chek(a)==True:
if matrixForm_chek(b)==True:
if twoMatrix_check(a,b)==True:
return True
else:
print("Error! two matrices are not . prodoctable.")
return False
else:
print("Error! Second array is not in the Matrix form")
return False
else:
print("Error! First array is not in the Matrix form")
return False
def zeroMatrix(n,m):
return [[0. for i in range(m)] for j in range(n)]
def aDb(a,b):
if check_matrix(a,b)==True:
n=len(a)
m=len(b[0])
c=zeroMatrix(n,m)
for i in range(len(c)):
for j in range(len(c[0])):
x=0
for k in range(len(c[0])):
x=x+a[i][k]*b[k][j]
c[i][j]=x
return c
a=[[1,2,3],[2,3,1],[8,12,3]]
b=[[1,3,4],[6,1,5],[5,3,1]]
print(aDb(a,b))
import numpy as np
list0=[1,6,8,5,4,8]
list0.append(9)
list0np=np.array(list0)
type(list0)
type(list0np)
np.max(list0np)
np.mean(list0np)
np.var(list0np)