Python Forum
If statement not separating Albums
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If statement not separating Albums
#2
What is ft, nt, alb, filezto?

Please describe in words what you want to do and post some example data.

One very non-pythonic pattern is: for x in range(len(sequence))

Better is:
for index, element in enumerate(sequence):
    print(index, element)
And if element is not required:
for index, _ in enumerate(sequence):
    print(index, element)
The _ is a throw away name (variable).

And if you just to repeat something, where index and the element is not needed:
for _ in range(len(sequence))
    print("Working...")
I like more the enumerate-solution. Looks nicer. Lesser parenthesis.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
If statement not separating Albums - by giddyhead - Feb-26-2021, 09:48 AM
RE: If statement not separating Albums - by DeaD_EyE - Feb-26-2021, 10:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error getting tracks from albums ozzyk 7 4,834 Nov-22-2017, 07:33 PM
Last Post: snippsat
  Getting top albums from last.fm ozzyk 1 3,086 Nov-19-2017, 09:40 PM
Last Post: heiner55
  Separating a string into evenly sized elements in a list kennybassett 9 6,535 Jun-14-2017, 08:22 AM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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