loop structures and booleans valid numberpositive or negative of coursethis is impossible as long as we restrict ourselves to working with numbers no matter what number or range of numbers we pick as sentinelit is always possible that some data set may contain such number in order to have truly unique sentinelwe need to broaden the possible inputs suppose that we get the input from the user as string we can have distinctivenon-numeric string that indicates the end of the inputall others would be converted into numbers and treated as data one simple solution is to have the sentinel value be an empty string rememberan empty string is represented in python as "(quotes with no space betweenif the user types blank line in response to input (just hits )python returns an empty string we can use this as simple way to terminate input the design looks like thisinitialize sum to initialize count to input data item as stringxstr while xstr is not empty convert xstr to numberx add to sum add to count input next data item as stringxstr output sum count comparing this to the previous algorithmyou can see that converting the string to number has been added to the processing section of the sentinel loop translating it into python yields this programaverage py def main()sum count xstr input("enter number to quit>"while xstr !"" eval(xstrsum sum count count xstr input("enter number to quit>"print("\nthe average of the numbers is"sum countmain(this code does not turn the input into number (via evaluntil after it has checked to make sure the input was not the sentinel (""here is an example runshowing that it is now possible to average arbitrary sets of numbers