Skip to content

Instantly share code, notes, and snippets.

View tabris2015's full-sized avatar
🏠
Working from home

Jose Eduardo Laruta Espejo tabris2015

🏠
Working from home
View GitHub Profile
@tabris2015
tabris2015 / depthFirstSearch.py
Created March 6, 2020 20:54
Pista Ejercicio 1 - Laboratorio Algoritmos de Búsqueda
def depthFirstSearch(problem):
"""
Search the deepest nodes in the search tree first.
Your search algorithm needs to return a list of actions that reaches the
goal. Make sure to implement a graph search algorithm.
To get started, you might want to try some of these simple commands to
understand the search problem that is being passed in:
print("Start:", problem.getStartState())
print("Is the start a goal?", problem.isGoalState(problem.getStartState()))
print("Start's successors:", problem.getSuccessors(problem.getStartState()))
@tabris2015
tabris2015 / pista_ejercicio_2.py
Created February 21, 2020 13:28
Pistas Laboratorio 1
#### PISTA EJERCICIO 2 ####
calificaciones_estudiantes = [('jose', 76),('mariana', 96),('jorge', 58),('esteban', 88),('julia', 45)]
def calcular_promedio(estudiantes):
"""Esta funcion toma como argumento una lista de tuplas (estudiante, nota) y
devuelve la nota promedio de todos los estudiantes"""
acumulado = 0
for estudiante in estudiantes:
acumulado += estudiante[1]