I am new to programming and am currently doing exercises in the Zed Shaw Python book. In Zed Ex41, there is such a function:
def runner(map, start): next = start while True: room = map[next] print "\n-------" next = room()
My question is, why did he have to designate the "beginning" of the variable "next" when he could immediately "start"? Why didn't he just do it?
def runner(map, start): while True: room = map[start] print "\n-------" start = room()
Because this function also works. Thanks
source share