Compilador Python online
Use this site
https://repl.it/languages/python3
Erorri Motrali
Use this site
https://repl.it/languages/python3
This is the best online compler for python which I've used.
Probably you will find it on the top of your search resluts too.
https://www.programiz.com/python-programming/online-compiler/
# some best python compilers are:
https://repl.it/ # best online compiler
https://www.onlinegdb.com/online_python_compiler/
https://www.tutorialspoint.com/execute_python_online.php/
https://www.programiz.com/python-programming/online-compiler/
Use this site
https://www.programiz.com/python-programming/online-compiler/
import aima.utils
import aima.logic
def main():
clauses = []
clauses.append(aima.utils.expr("(American(x) & Weapon(y) & Sells(x, y, z) & Hostile(z)) ==>Criminal(x)"))
clauses.append(aima.utils.expr("Enemy(Nono, America)"))
clauses.append(aima.utils.expr("Owns(Nono, M1)"))
clauses.append(aima.utils.expr("Missile(M1)"))
clauses.append(aima.utils.expr("(Missile(x) & Owns(Nono, x)) ==> Sells(West, x, Nono)"))
clauses.append(aima.utils.expr("American(West)"))
clauses.append(aima.utils.expr("Missile(x) ==> Weapon(x)"))
KB = aima.logic.FolKB(clauses)
KB.tell(aima.utils.expr('Enemy(Coco, America)'))
KB.tell(aima.utils.expr('Enemy(Jojo, America)'))
KB.tell(aima.utils.expr("Enemy(x, America) ==> Hostile(x)"))
hostile = aima.logic.fol_fc_ask(KB, aima.utils.expr('Hostile(x)'))
criminal = aima.logic.fol_fc_ask(KB, aima.utils.expr('Criminal(x)'))
print('Hostile?')
print(list(hostile))
print('\nCriminal?')
print(list(criminal))
print()
if __name__ == "__main__": main()