Counting with a While Loop in Python

preview_player
Показать описание


In this video we look at how to use a traditionally conditional loop, the while loop, as a counting loop. We look at issues that might arise from that, such as infinite loops, and how to improve the speed that we develop our code by using some shortcut techniques.
Рекомендации по теме
Комментарии
Автор

Hello,
How would I implement a node count in this code:
def

fringe = [Node(problem.initial)] # Stack
while fringe:
node = fringe.pop()
if

print("succes!")
print("solution: {}".format(node.solution()))
return node


print("unfortunately no solution has been found!")
return None

Appreciate your help + enjoy your vids.

priyankvenkatesh