использовать Робот
алг
нач
нц пока слева свободно
влево
кц
нц пока слева стена
вниз
кц
вверх
вверх
нц пока сверху свободно
закрасить
вверх
кц
закрасить
нц пока сверху стена
вправо
кц
вверх
влево
нц пока снизу стена
влево
кц
вправо
нц пока снизу стена
закрасить
вправо
кц
закрасить
вверх
нц пока слева стена
закрасить
вверх
кц
кон
Объяснение:
картинки
Длина стен произвольная, но расположение должно сохранятся, т.е. нижняя вертикальная стена всегда должна быть соединена верхним концом с левым концом горизонтальной стены и нижний конец верхней вертикальной стена должен располагаться строго над правым концом горизонтальной стены на расстоянии 1 клетки
Красим как на картинке, а не как написано



import random import operator def quiz(): print('Welcome. This is a 10 question math quiz\n') name = input("Please enter your name") print("Hello", name," Let's begin the quiz!") score = 0 for i in range(10): correct = askQuestion() if correct: score += 1 print('Correct!\n') print(score) break else: print('Incorrect!\n') return 'Your score was {}/10'.format(score) def askQuestion(): answer = randomCalc() guess = float(input()) return guess == answer def randomCalc(): ops = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv} num1 = random.randint(0,11) num2 = random.randint(1,11) op = random.choice(list(ops.keys())) answer = ops.get(op)(num1,num2) print('What is {} {} {}?\n'.format(num1, op, num2))
import random import operator def quiz(): print('Welcome. This is a 10 question math quiz\n') name = input("Please enter your name") print("Hello", name," Let's begin the quiz!") score = 0 for i in range(10): correct = askQuestion() if correct: score += 1 print('Correct!') print "Score",(score),"\n" else: print('Incorrect!') print "Score",(score), "\n" print 'Your score was {}/10'.format(score) def askQuestion(): answer = randomCalc() guess = float(input()) return guess == answer def randomCalc(): ops = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv} num1 = random.randint(0,11) num2 = random.randint(1,11) op = random.choice(list(ops.keys())) answer = ops.get(op)(num1,num2) print('What is {} {} {}?'.format(num1, op, num2)) return answer quiz() #askQuestion() #randomCalc()