Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
strange output
#3
(Nov-18-2019, 08:31 PM)buran Wrote: left-hand [0] is a list with one element - 0.
the right-hand [0] is indexing - you access the 0-indexed element, which is 0

to be more clear
print([1][0])
will print 1

Now I understand, thanks !
Reply


Messages In This Thread
strange output - by KaliLinux - Nov-18-2019, 08:28 PM
RE: strange output - by buran - Nov-18-2019, 08:31 PM
RE: strange output - by KaliLinux - Nov-19-2019, 09:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Strange output kintarowonders 6 2,962 May-08-2020, 05:20 PM
Last Post: buran
  Strange output with regular expressions newbieAuggie2019 1 1,939 Nov-04-2019, 07:06 PM
Last Post: newbieAuggie2019

Forum Jump:

User Panel Messages

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