Python Forum
Zen of Python violated by Python
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Zen of Python violated by Python
#6
I've worked so many times with binary data, chunking it etc.
A 0-based indexing feels more natural.


data = list(range(1, 101, 10)
two_elements = data[:2]
next four_elements = data[2:2+4]
How does this look with 1-based indexing?
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
Zen of Python violated by Python - by hou32hou - Jul-02-2018, 05:55 AM
RE: Zen of Python violated by Python - by micseydel - Jul-02-2018, 06:13 AM
RE: Zen of Python violated by Python - by wavic - Jul-02-2018, 07:43 AM
RE: Zen of Python violated by Python - by buran - Jul-02-2018, 08:36 AM
RE: Zen of Python violated by Python - by Skaperen - Jul-04-2018, 03:05 AM
RE: Zen of Python violated by Python - by DeaD_EyE - Jul-04-2018, 10:36 AM
RE: Zen of Python violated by Python - by Skaperen - Jul-05-2018, 01:21 AM
RE: Zen of Python violated by Python - by metulburr - Jul-04-2018, 01:19 PM
RE: Zen of Python violated by Python - by DeaD_EyE - Jul-06-2018, 08:10 AM
RE: Zen of Python violated by Python - by Larz60+ - Jul-04-2018, 04:34 PM
RE: Zen of Python violated by Python - by snippsat - Jul-04-2018, 05:32 PM
RE: Zen of Python violated by Python - by Larz60+ - Jul-04-2018, 05:45 PM
RE: Zen of Python violated by Python - by Skaperen - Jul-06-2018, 04:29 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020