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 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 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
Get step-by-step solutions from verified subject matter experts
