だから、私は以下のこの機能を持っています:
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かTrueか?そして、値が何もない場合、そこに戻り値があるという点は何ですか?
ありがとう!