New submission from LittleGuy <674980...@qq.com>:

# There is a question when I use list.
# If I run this following code:

x = list(range(10))
a = x[1 : -1 : -1]
print(a)

# the answer will be:
[]

# the right answer should be: [1, 0]
# But in some cases, it works well, like:

a = x[4 : 2 : -1]
print(a)

# the answer will be:
[4, 3]

# so, there may be some problems.

----------
components: Regular Expressions
messages: 389220
nosy: YangS007, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: A Question about List Slice
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43580>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to