Python Forum
Absolutely new to python - basic advise needed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Absolutely new to python - basic advise needed
#1
Dear community,

I am absolutely new to Python but like to learn it.
Could you pls help to understand following code ( I dont understand the bold portion of the code):

# enumerate function in loops 
l1 = ["eat","sleep","repeat"] 
  
# printing the tuples in object directly 
for ele in enumerate(l1): 
    print (ele) 

# changing index and printing separately
# I don't understand next part
for count,ele in enumerate(l1,100): 
    print (count,ele) 
So i dont understand what does count,ele is ? Shouldn't it be one variable after for? what is the comma in between count and ele? And why it removes parentheses in output?
Reply


Messages In This Thread
Absolutely new to python - basic advise needed - by mariolucas75 - Jun-12-2020, 08:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python issue - Data science - Help is needed yovel 2 2,036 Jul-29-2021, 04:27 PM
Last Post: yovel
  Basic python Natters10 3 3,122 Nov-29-2020, 07:04 AM
Last Post: Love2code
  Help needed for a python package keysson 1 2,248 Sep-02-2020, 03:37 AM
Last Post: Larz60+
  I need advise with developing a brute forcing script fatjuicypython 11 5,161 Aug-21-2020, 09:20 PM
Last Post: Marbelous
  Help with basic python AaronG123 4 2,305 Nov-14-2019, 02:57 PM
Last Post: AaronG123
Smile Help needed. Python Newbie!, it will be fun. knightdea 3 2,660 Oct-13-2019, 08:50 AM
Last Post: perfringo
  Please, advise collections for my task AlekseyPython 1 2,128 Sep-11-2019, 12:44 PM
Last Post: perfringo
  help needed with python launcher fallenlight 3 3,404 Jan-19-2019, 01:06 PM
Last Post: snippsat
  Basic Help Needed JohnV 2 2,430 Jan-09-2019, 09:43 PM
Last Post: buran
  Very basic programming help needed: pig latin program bstocks 2 8,020 Dec-02-2017, 08:12 AM
Last Post: RickyWilson

Forum Jump:

User Panel Messages

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