Please enable JavaScript to use CodeHS

CodeHS Glossary


extend() Python

Takes a list as an argument and extends the current list with the list given as an argument.

current_list = ["hi", "hello"]
current_list.extend(["greetings", "hey"])
# current_list will now be ["hi", "hello", "greetings", "hey"]