I can't check extra test
I check and look on to http://www.pythontutor.com/visualize.html gonna sometping strange. Cycle for work 3 time and continue to next block. And i don't understand wy. Help, please. P.S. Sorry to my ugly code.
def house(plan): spisok = plan.splitlines() if "" in spisok: spisok.remove("") counter = 0 for element in spisok: for element2 in element: if element2 == "0": counter += 1 if counter == len(element): spisok.remove(element) counter = 0 else: continue else: counter = 0 break counter = 0 spisok2 = [] while counter != len(element): x = [item[counter] for item in spisok] spisok2.append(x) counter += 1 counter = 0 for element in spisok2: for element2 in element: if element2 == "0": counter += 1 if counter == len(element): spisok2.remove(element) counter = 0 else: continue else: counter = 0 break return (len(spisok2))*(len(spisok2[0])) if __name__ == '__main__': print("Example:") print(house(''' 0000000 ##00##0 ######0 ##00##0 #0000#0 ''')) #These "asserts" using only for self-checking and not necessary for auto-testing assert house(''' 0000000 ##00##0 ######0 ##00##0 #0000#0 ''') == 24 assert house('''0000000000 #000##000# ########## ##000000## 0000000000 ''') == 30 assert house('''0000 0000 #000 ''') == 1 assert house('''0000 0000 ''') == 0 assert house(''' 0##0 0000 #00# ''') == 12 print("Coding complete? Click 'Check' to earn cool rewards!")