Trying to read multi-line console input with my program. But as of know I need to press enter twice before the actual reading begins? Does anyone understand why? Am I using the input() function the wrong way?
Input data look like this:
Input data look like this:
Quote:...........*........
....*.....*.........
.........*..*...*...
*..*..*......***....
..*.....*...........
.*..................
.......*.........*.*
....................
.....*............*.
..........
.*.**.*...
*....*.*.*
..........
..*.....*.
def main(): lines = [] number_of_empty_lines = 0 while True: line = input() if not line: number_of_empty_lines += 1 if number_of_empty_lines == 2: break else: number_of_empty_lines = 0 pass lines.append(line) numberOfStars = 0 for i in lines: if i == "": print() numberOfStars = 0 continue starCounter = i.count("*") print("." * (len(i) - starCounter- numberOfStars), end="") print("*" * starCounter, end="") print("." * numberOfStars) numberOfStars += starCounter