Skip to content

Computed and negative slices #251

@texcoffier

Description

@texcoffier

There are some slices examples, some not working:

print("Must display : [1, 'a', 'b', 'c', 5]")

a = [1, 2, 3, 4, 5]
a[1:4] = ['a', 'b', 'c']
print(a) # Works

a = [1, 2, 3, 4, 5]
a[1:3+1] = ['a', 'b', 'c']
print(a) # Works

a = [1, 2, 3, 4, 5]
a[0+1:4] = ['a', 'b', 'c']
print(a) # Doesn't works

a = [1, 2, 3, 4, 5]
a[1:-1] = ['a', 'b', 'c']
print(a) # Doesn't works

a = [1, 2, 3, 4, 5]
a[0+1:-1] = ['a', 'b', 'c']
print(a) # Doesn't works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions