miscellaneous topics flag variables flag variable can be used to let one part of your program know when something happens in another part of the program here is an example that determines if number is prime num eval(input'enter number')flag for in range( ,num)if num% == flag if flag== print'not prime 'elseprint'prime 'recall that number is prime if it has no divisors other than and itself the way the program above works is flag starts off at we then loop from to num- if one of those values turns out to be divisorthen flag gets set to once the loop is finishedwe check to see if the flag got set or not if it didwe know there was divisorand num isn' prime otherwisethe number must be prime maxes and mins common programming task is to find the largest or smallest value in series of values here is an example where we ask the user to enter ten positive numbers and then we print the largest one largest eval(input'enter positive number')for in range( )num eval(input'enter positive number')if num>largestlargest=num print'largest number'largestthe key here is the variable largest that keeps track of the largest number found so far we start by setting it equal to the user' first number thenevery time we get new number from the userwe check to see if the user' number is larger than the current largest value (which is stored in largestif it isthen we set largest equal to the user' number ifinsteadwe want the smallest valuethe only change necessary is that becomes <though it would also be good to rename the variable largest to smallest later onwhen we get to listswe will see shorter way to find the largest and smallest valuesbut the technique above is useful to know since you may occasionally run into situations where the list way won' do everything you need it to do