Итак, у меня есть эта функция ниже:Какой смысл возврата в этом коде?
def remove_all(lst):
i = 0
while i < 10:
try:
print('Removing... ')
print(int(lst.pop()) + 10)
print("Removed successfully.")
# As soon as an IndexError is raised, jump to the following block of code...
except IndexError as err:
# if you encounter an indexerror, do the following:
print("Uh oh! Problems.")
return
#As soon as a Value error is raised, jump here.
except ValueError as err:
print("Not a number")
i = i + 1
Что возвращение делать? После возвращения нет значения, значит ли это значение «Нет» или «Истина»? И в чем смысл возвращения туда, если значение равно none?
Спасибо!
Он будет возвращать 'None'. –