loop structures and booleans main(as you can seethe loop that processes the numbers in line is indented inside of the file processing loop the outer while loop iterates once for each line of the file on each iteration of the outer loopthe inner for loop iterates as many times as there are numbers on that line when the inner loop finishesthe next line of the file is readand the outer loop goes through its next iteration the individual fragments of this problem are not complex when taken separatelybut the final result is fairly intricate the best way to design nested loops is to follow the process we did here first design the outer loop without worrying about what goes inside then design what goes insideignoring the outer loop(sfinallyput the pieces togethertaking care to preserve the nesting if the individual loops are correctthe nested result will work just finetrust it with little practiceyou'll be implementing double-even triple-nested loops with ease computing with booleans we now have two control structuresif and whilethat use conditionswhich are boolean expressions conceptuallya boolean expression evaluates to one of two valuesfalse or true in pythonthese values are represented by the literals false and true so farwe have used simple boolean expressions that compare two values ( while > boolean operators sometimes the simple conditions that we have been using do not seem expressive enough for examplesuppose you need to determine whether two point objects are in the same position--that isthey have equal coordinates and equal coordinates one way of handling this would be nested decision if getx(= getx()if gety(= gety()points are the same elsepoints are different elsepoints are different you can see how awkward this is instead of working around this problem with decision structureanother approach would be to construct more complex expression using boolean operations like most programming languagespython provides three boolean operatorsandorand not let' take look at these three operators and then see how they can be used to simplify our problem the boolean operators and and or are used to combine two boolean expressions and produce boolean result