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
#3
I found it hard to understand first as well
My definition of a for loop where it's for a in array the for loop will go through every object in array and each time, the object can be identified as a.

Here's an example
array = ['start', 1, 3, 2, 'finish']
for item in array:
    print(item)
Output:
start 1 3 2 finish
array = range(1, 26) #Returns all the number 1-25 (It doesn't include the 26)
for number in array:
    print(number)
Output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
I hope this helps
Reply


Messages In This Thread
RE: Super newbie trying to understand certain concepts - by SheeppOSU - Oct-27-2019, 05:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with super() Hoespilaar 3 470 Jun-11-2024, 02:15 AM
Last Post: kanetracy
  super() in class akbarza 1 611 Dec-19-2023, 12:55 PM
Last Post: menator01
  super newbie question: escape character tsavoSG 3 2,595 Jan-13-2021, 04:31 AM
Last Post: tsavoSG
  superclass and super() grkiran2011 1 1,814 Jun-20-2020, 04:37 AM
Last Post: deanhystad
  MRO About super() catlessness 1 2,135 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,663 May-04-2019, 08:30 PM
Last Post: Shafla
  Is any super keyword like java rajeev1729 2 3,416 Sep-14-2017, 07:47 PM
Last Post: snippsat
  Multiple Inheritance using super() Sagar 2 7,400 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