Python Forum
Super newbie trying to understand certain concepts
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Super newbie trying to understand certain concepts
#6
In addition to newbieAuggie2019 thorough answer - print() is cheap way to understand what is going on:

In [1]: lst = [1, 2, 3] 
   ...: for v in range(len(lst)): 
   ...:     print(lst)                 # lst before insert
   ...:     lst.insert(1, lst[v]) 
   ...:     print(lst)                 # lst after insert
   ...:                                                                                         
[1, 2, 3]             
[1, 1, 2, 3]
[1, 1, 2, 3]
[1, 1, 1, 2, 3]
[1, 1, 1, 2, 3]
[1, 1, 1, 1, 2, 3]
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
RE: Super newbie trying to understand certain concepts - by perfringo - Oct-27-2019, 07:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with super() Hoespilaar 2 282 Apr-10-2024, 10:10 AM
Last Post: Hoespilaar
  super() in class akbarza 1 485 Dec-19-2023, 12:55 PM
Last Post: menator01
  super newbie question: escape character tsavoSG 3 2,493 Jan-13-2021, 04:31 AM
Last Post: tsavoSG
  superclass and super() grkiran2011 1 1,756 Jun-20-2020, 04:37 AM
Last Post: deanhystad
  MRO About super() catlessness 1 2,061 Jan-12-2020, 07:54 AM
Last Post: Gribouillis
  Super with Sublime Text - TypeError: super() takes at least 1 argument (0 given) Shafla 6 7,496 May-04-2019, 08:30 PM
Last Post: Shafla
  Is any super keyword like java rajeev1729 2 3,326 Sep-14-2017, 07:47 PM
Last Post: snippsat
  Multiple Inheritance using super() Sagar 2 7,323 Sep-08-2017, 08:58 AM
Last Post: Sagar

Forum Jump:

User Panel Messages

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