You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Andrew Burke edited this page Apr 3, 2024
·
5 revisions
defhalve_list(lst): # Function signatureresult= [] # Create a list to store halved valuesfornumberinlst: # Loop through numbers in input listhalved=number/2# Divide number by tworesult.append(halved) # Append halved number to end of input listreturnresult# return result listhalve_list([2,4,6,8]) # Call the function