I am trying to use append command, and it doesnt work. Is this code written correctly?
cool_list = “luisgamercool”, “flimflam”, “flamingo”
print(cool_list)
cool_list.append(“ok”)
print(cool_list)
I am trying to use append command, and it doesnt work. Is this code written correctly?
cool_list = “luisgamercool”, “flimflam”, “flamingo”
print(cool_list)
cool_list.append(“ok”)
print(cool_list)
Welcome to DPO! You need square brackets to make that a list:
cool_list = ["luisgamercool", "flimflam", "flamingo"]
(Without the brackets, it’s a “tuple”, which you can’t append stuff to.)
Thank you so much, it worked.