Skip to main content
Revertido a la revisión 1
Origen Enlace
fedorqui
  • 16.7k
  • 24
  • 71
  • 134

hgfjfyuffyufuyfy yfyrtershss Interprete LISP en Python

hgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershssestoy realizando un intérprete de LISP en Python, específicamente con las operaciones aritméticas elementales (+ - * /), he logrado realizar las operaciones de expresiones como por ejemplo ( + 10 -15 2 ) o ( * 7 6 7 3 ). Ahora, para expresiones como ( + ( * ( / 8 7 ) 15 ) -2 ) no logro poder emplear lo que realicé para las expresiones anteriores, aquí el código empleado.

def sumalista(lista):
i=1
suma = 0
for i in lista:
    suma = suma + i
return suma

def productolista(lista):
i=1
producto=1
for i in lista:
    producto=producto*i
return producto

m=input("Introduce la s-expression:");
y=m.split()

if y[1]=="+":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])+sumalista(x))
elif y[1]=="-":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])-sumalista(x))
elif y[1]=="*":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*productolista(x))
elif y[1]=="/":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*1/productolista(x))

hgfjfyuffyufuyfy yfyrtershss

hgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershss

Interprete LISP en Python

estoy realizando un intérprete de LISP en Python, específicamente con las operaciones aritméticas elementales (+ - * /), he logrado realizar las operaciones de expresiones como por ejemplo ( + 10 -15 2 ) o ( * 7 6 7 3 ). Ahora, para expresiones como ( + ( * ( / 8 7 ) 15 ) -2 ) no logro poder emplear lo que realicé para las expresiones anteriores, aquí el código empleado.

def sumalista(lista):
i=1
suma = 0
for i in lista:
    suma = suma + i
return suma

def productolista(lista):
i=1
producto=1
for i in lista:
    producto=producto*i
return producto

m=input("Introduce la s-expression:");
y=m.split()

if y[1]=="+":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])+sumalista(x))
elif y[1]=="-":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])-sumalista(x))
elif y[1]=="*":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*productolista(x))
elif y[1]=="/":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*1/productolista(x))
se añadieron 829 caracteres en el cuerpo; etiquetas editadas; título editado
Origen Enlace

Interprete LISP en Python hgfjfyuffyufuyfy yfyrtershss

estoy realizando un intérprete de LISP en Python, específicamente con las operaciones aritméticas elementales (+ - * /), he logrado realizar las operaciones de expresiones como por ejemplo ( + 10 -15 2 ) o ( * 7 6 7 3 ). Ahora, para expresiones como ( + ( * ( / 8 7 ) 15 ) -2 ) no logro poder emplear lo que realicé para las expresiones anteriores, aquí el código empleado.hgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershss

def sumalista(lista):
i=1
suma = 0
for i in lista:
    suma = suma + i
return suma

def productolista(lista):
i=1
producto=1
for i in lista:
    producto=producto*i
return producto

m=input("Introduce la s-expression:");
y=m.split()

if y[1]=="+":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])+sumalista(x))
elif y[1]=="-":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])-sumalista(x))
elif y[1]=="*":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*productolista(x))
elif y[1]=="/":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*1/productolista(x))

Interprete LISP en Python

estoy realizando un intérprete de LISP en Python, específicamente con las operaciones aritméticas elementales (+ - * /), he logrado realizar las operaciones de expresiones como por ejemplo ( + 10 -15 2 ) o ( * 7 6 7 3 ). Ahora, para expresiones como ( + ( * ( / 8 7 ) 15 ) -2 ) no logro poder emplear lo que realicé para las expresiones anteriores, aquí el código empleado.

def sumalista(lista):
i=1
suma = 0
for i in lista:
    suma = suma + i
return suma

def productolista(lista):
i=1
producto=1
for i in lista:
    producto=producto*i
return producto

m=input("Introduce la s-expression:");
y=m.split()

if y[1]=="+":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])+sumalista(x))
elif y[1]=="-":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])-sumalista(x))
elif y[1]=="*":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*productolista(x))
elif y[1]=="/":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*1/productolista(x))

hgfjfyuffyufuyfy yfyrtershss

hgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershsshgfjfyuffyufuyfy yfyrtershss

Origen Enlace

Interprete LISP en Python

estoy realizando un intérprete de LISP en Python, específicamente con las operaciones aritméticas elementales (+ - * /), he logrado realizar las operaciones de expresiones como por ejemplo ( + 10 -15 2 ) o ( * 7 6 7 3 ). Ahora, para expresiones como ( + ( * ( / 8 7 ) 15 ) -2 ) no logro poder emplear lo que realicé para las expresiones anteriores, aquí el código empleado.

def sumalista(lista):
i=1
suma = 0
for i in lista:
    suma = suma + i
return suma

def productolista(lista):
i=1
producto=1
for i in lista:
    producto=producto*i
return producto

m=input("Introduce la s-expression:");
y=m.split()

if y[1]=="+":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])+sumalista(x))
elif y[1]=="-":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])-sumalista(x))
elif y[1]=="*":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*productolista(x))
elif y[1]=="/":
  y_1=y[3:len(y)-1]
  x=list(map( float, y_1))
  print(float(y[2])*1/productolista(x))