Mar-31-2017, 01:47 AM
a classic loop structure tests for one of a sequence of possible conditions. in python the loop iterates over an iterator or equivalent (a sequence). a variable starts at an initial state and is set by the condition. it is then tested after the loop.
here is an example:
here is an example:
unsafe = False for part in filename.split('/'): if part == '..': unsafe = True if unsafe: raise UnsafeFileError(filename)what i am looking for is if python has any simpler-code method for doing this kind of test. since this is a example it needs to be not specific to this example. any clues?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.