Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

subo proyecto 2

  • Loading branch information...
commit a60c1b7b3a3cbe4e6cc38bc8a40f426b541f9f04 1 parent 85c213a
addiaz12 authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 prueba1.py
18 prueba1.py
View
@@ -0,0 +1,18 @@
+from pyswip import Functor, Variable, Query, call
+
+def animal(raza,nombre,genero,edad,ecosistema,comida):
+ assertz = Functor("assertz", 1)
+ raz = Functor(raza, 5)
+
+ call(assertz(raz(nombre,genero,edad,ecosistema,comida)))
+
+ A = Variable()
+ B = Variable()
+ C = Variable()
+ D = Variable()
+
+ q = Query(raz(nombre,A,B,C,D))
+ while q.nextSolution():
+ print "Hola", nombre,A.value, B.value, C.value, D.value
+ q.closeQuery()
+animal("perro","firulais","M","5","bosque","ascan")
Please sign in to comment.
Something went wrong with that request. Please try again.