The class element has a member function of function (), which returns a list of strings. The Dictionary class has an element of a member function () that returns a list of elements. dict is an example of a dictionary. I want to check if all characters in all lines in all dict, ASCII elements are. I tried
all(ord(ch) < 128 for ch in s for s in item.text() for item in dict.items())
This gives the error message "global name" is undefined. What is the right way?
source
share