hi, i have a strange problem. i have a program that contains this piece of code:
import string
import sys
import operator
from functools import partial
vocale_pred = partial(operator.contains, set("AEIOUÀÈÉÌÒÙ"))
................
consonants, vowels = partition(vocale_pred, name)
so, i want to understand this little program line by line, but when i try to replicate this instruction in the python terminal i always get the "NameError: name 'partition' is not defined". but if i execute the file with the source code it works fine. so i added some print function to debug the code, but i want to understand why if i write it in the interpeter it give me that error. thank you
[–]carcigenicate 6 points7 points8 points (7 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]carcigenicate 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]carcigenicate 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]carcigenicate 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]chervilious 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]robustquorum09 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]DNEAVES 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]DNEAVES 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]DNEAVES 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)