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
print(song_array) #this works because we reversed the list on line 11.
#Solution 2:
empty_list= []
length=len(song_array)
foriinrange(length-1, -1, -1):
empty_list.append(song_array[i])
print(empty_list)
defdetermineCharInList():
song_array= ["Red", "99", "Balloons"]
foreleminsong_array:
ifelem.isdigit():
print(f"index location: {song_array.index(elem)} is an integer")
# if __name__ == "__main__": is used to execute some code only if the file was run directly, and not imported. If you import this script as a module in another script, the code under if __name__ == "__main__": will not be executed. In that case you should use the def main() function and call it from the other script.