Начал изучать Python, и наткнулся на сайтик codecademy, на котором после изучения теории предлагается решить практическую задачку. Все шло хорошо, но вот застрял на одной. Подскжите, где я туплю?
Задание:
1. First, def a function, shut_down, that takes one argument s. Don't forget the parentheses or the colon!
2. Then, if the shut_down function receives an s equal to “yes”, it should return “Shutting down”
3. Alternatively, elif s is equal to “no”, then the function should return “Shutdown aborted”.
4.Finally, if shut_down gets anything other than those inputs, the function should return “Sorry”
Мое решение:
def shut_down(s): #создаем функцию shut_down с переменной s return s if s=="yes": #если переменная s равна yes, то return "Shutting down" # возвращается значение "Shutting down" elif s=="no": #если переменная s равна no, то return "Shutdown aborted" # возвращается значение "Shutdown aborted" else: # если ни одно условие не выполняется return "Sorry" #возвращается значение "Sorry"
Oops, try again. Your function failed on the message yes. It returned ‘yes’ when it should have returned ‘Shutting down’
Где моя ошибка, помогите
