here is my script :
time_remaining = [1, 2, 3, 4]
url_links = ["a", "b", "c"]
nb_bookies = ['5', '7', '6']
def gitanerie(time, url, book):
if len(time) != len(url):
url = url.append('d')
book = book.append('1')
else:
pass
return url, nb_bookies
url_links, nb_bookies = gitanerie(time_remaining, url_links, nb_bookies)
print(url_links)
print(nb_bookies)
When I run it it gives me :
None
['5', '7', '6', '1']
the url_kinks is empty. How to solve this problem. Thanks
url.append('d')modifies the list in-place and returnsNone. Hence, don't reassign the return value.