Traduccion al lenguaje python de un código de instrucciones que esta escrito en lenguaje excel .
Publicado por Jose Luis (2 intervenciones) el 22/05/2020 11:36:38
El código de instrucciones que les pido que traduzcan del lenguaje excel o el open office al python3 es el siguiente(también se puede considerar que el código esta escrito en lenguaje visual basic 5.0 o 6.0):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Public function partic(n)
dim(40,40)
dim i,s,h,k
if n=1 then partic=1:exit function
k=n
for i=1 to n
a(1,i)=1
a(i,i)=1
next i
for h=2 to n
for i=2 to h-1
m=h-i
s=0
for j=1 to i:s=s+a(j,m):next j
a(i,h)=s
next i
next h
for h=1 to n
s=0
for i=1 to k
s=s+a(i,h)
next i
next h
partic=s
end function
Valora esta pregunta


0