Question: in python which reads many Write a program, in a file named indentation_print.py , lines from the user, in a loop; the easiest way to

in pythonin python which reads many Write a program, in a file named

which reads many Write a program, in a file named indentation_print.py , lines from the user, in a loop; the easiest way to do this will be an infinite loop: while True: which uses break to end the loop when needed. For each line of input, count how many spaces there were at the beginning of the line, and print that out. (Note that some lines might have no leading spaces, and some might be entirely empty.) Terminate your loop when the user types quit on any input line. For this check, you should ignore all whitespace (that is, the user might type many spaces before and after quit), but only quit if quit is the only non-whitespace text on the line. You may assume that the input will always eventually include a quit line. NOTE: Do not count the indentation on the quit line. Simply break that loop at that point, without counting

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!