Adding and removing integers from a list

Report a typo

You are building a simple program. The program starts with a list of integers. The goal is to add a new integer at the end of the list, then remove the first occurrence of a specified integer from the list. All you need to do is fill the blanks in the provided code to complete the functionality.

Fill in the gaps with the relevant elements
# Define a list of integers
numbers = [5, 2, 9, 1, 5, 6]

# Append a value to the end of the list
numbers.(10)

# Remove the first occurrence of a value
numbers.(5)

# Print the updated list
print(f"Updated numbers list: {numbers}")
appendremove
___

Create a free account to access the full topic