Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List vs index:
#6
Funny enough, doing this with ord (not the task) gives accidentally the same result.
"".join(c for c in 'pynative' if ord(c) % 2 == 0)
Output:
'pntv'
Coincidence?
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
List vs index: - by Frederico_Caldas - Jul-01-2020, 03:11 AM
RE: List vs index: - by ndc85430 - Jul-01-2020, 03:59 AM
RE: List vs index: - by deanhystad - Jul-01-2020, 01:14 PM
RE: List vs index: - by Frederico_Caldas - Jul-03-2020, 01:24 AM
RE: List vs index: - by perfringo - Jul-03-2020, 06:28 AM
RE: List vs index: - by DeaD_EyE - Jul-03-2020, 10:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to fix list index out of range longmen 26 6,113 Apr-27-2022, 05:46 PM
Last Post: deanhystad
  list index out of range OliverG 3 2,360 Sep-03-2021, 12:04 AM
Last Post: itsmycode
  Index List a04j 2 2,939 Jul-10-2021, 01:14 PM
Last Post: BashBedlam
  List index out of range when turning CSV into dict ranbarr 15 6,504 May-12-2021, 10:38 AM
Last Post: ranbarr
  To find the index of the first occurrence of the key in the provided list Angry_bird89 4 3,292 Jun-20-2020, 06:53 PM
Last Post: Angry_bird89
  list index out of range mcgrim 2 2,927 May-25-2019, 07:44 PM
Last Post: mcgrim
  IndexError: list index out of range abdullahali 4 3,899 Jan-17-2019, 07:54 AM
Last Post: buran
  "List index out of range" for output values pegn305 3 5,329 Nov-26-2017, 02:20 PM
Last Post: heiner55
  list index out of range DrPengin 1 3,710 Nov-09-2017, 08:35 PM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

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