Python Forum
sorted function example mystery
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sorted function example mystery
#3
To illustrate DeaD_Eye answer with code:

>>> 'of'.index('f')
1
>>> 'of'.index('o')
0
>>> 'of'.index('a')
/.../
ValueError: substring not found
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
sorted function example mystery - by sabaidii2 - Feb-10-2020, 02:23 AM
RE: sorted function example mystery - by DeaD_EyE - Feb-10-2020, 07:35 AM
RE: sorted function example mystery - by perfringo - Feb-10-2020, 07:39 AM
RE: sorted function example mystery - by sabaidii2 - Feb-10-2020, 09:05 AM
RE: sorted function example mystery - by DeaD_EyE - Feb-10-2020, 09:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Failing to print sorted files tester_V 4 1,303 Nov-12-2022, 06:49 PM
Last Post: tester_V
  set and sorted, not working how expected! wtr 2 1,298 Jan-07-2022, 04:53 PM
Last Post: bowlofred
Shocked An array "mystery": The same array, the same operations but different outcomes mewss 3 2,187 Feb-17-2021, 06:34 PM
Last Post: mewss
  How to make elements return sorted? notsoexperienced 4 3,268 Sep-24-2020, 09:00 AM
Last Post: perfringo
  Why is my original list also sorted? Pedroski55 1 1,632 Jul-15-2020, 09:25 PM
Last Post: Yoriz
  Outputting Sorted Text files Help charlieroberrts 1 1,755 Jul-05-2020, 08:37 PM
Last Post: menator01
  Byte array is sorted when sending via USB daviddlc68 1 2,856 Aug-16-2019, 10:11 AM
Last Post: wavic
  sorted object in list trois 2 2,280 Mar-04-2019, 09:12 AM
Last Post: trois
  [Help] sorted() in while loop with user's input() {Screenshot attached} vanicci 5 4,034 Aug-04-2018, 08:59 PM
Last Post: vanicci
  understanding sorted key parameter amirt 2 2,783 Jul-30-2018, 06:27 PM
Last Post: amirt

Forum Jump:

User Panel Messages

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