Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error #514

Open
Meshackdd opened this issue Apr 24, 2024 · 1 comment
Open

Syntax error #514

Meshackdd opened this issue Apr 24, 2024 · 1 comment

Comments

@Meshackdd
Copy link

inserting items into a List

syntax

lst = ['item1', 'item2']
lst.insert(index, item)

fruits = ['banana', 'orange', 'mango', 'lemon']
fruits.insert(2, 'apple') # insert apple between orange and mango
print(fruits) # ['banana', 'orange', 'apple', 'mango', 'lemon']
fruits.insert(3, 'lime') # ['banana', 'orange', 'apple', 'lime', 'mango', 'lemon']
print(fruits)

The above code isn't running for me, keeps showing me ERROR message, same with adding g removing lists, removing items using pop.
Is it that theirs an extension I need to add or download on my VS code??? Please HELP...

@KarinaNi
Copy link

Could you please describe the error? Put the error message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants