[Tutor] What is the square brackets about?

Ege Berkay Gülcan egeberkay12 at gmail.com
Sat Jan 16 10:51:15 EST 2016


def get_(loc, thing):
    if loc==[]: return thing
    return get_(loc[1:], thing[loc[0]])

Hi I am new to Python and I would like to learn about these uses of square
brackets. I know that loc[1:] means loc list without the first element but
I do not know the meanings of loc==[] and thing[loc[0]].
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Bu
e-posta Avast tarafından korunan virüssüz bir bilgisayardan gönderilmiştir.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


More information about the Tutor mailing list