Python Forum
If statement not separating Albums
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If statement not separating Albums
#1
If statement does not separate between Albums from List. When ran it all prints Yes and when I used not equal all printed no. Why is it not checking to see if the Album is NT and print Yes and all others print No?

newtracks = List of updated file names from folder, filezto = List that was used to update files which is list newtracks. Album=List of Albums(OT and NT Only). With the exception of the list newtracks all were taken from a spreadsheet. What I am seeking to accomplish is to have it compare the files(newtracks) and (filezto) and check if the album is NT and if so print Yes else print No. The other last piece of the puzzle is to move those files that match to selected folders based upon a list from the spreadsheet . for ex file 01 Gen00 album: NT move to folders 1-GEN Gene, etc.

nt = 0
    ft = 0

    for alb in range(len(albm)):
                    
        while nt < len(newtracks):
            while ft < len(filezto):

                if albm[alb]  == 'NT' and newtracks[nt] == filezto[ft] :
                   
                        print('Yes', newtracks[nt] ,' ft', filezto[ft])

                else:
                        print('No', newtracks[nt], 'ft',filezto[ft])
                nt = nt +1
                ft = ft +1
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  error getting tracks from albums ozzyk 7 4,586 Nov-22-2017, 07:33 PM
Last Post: snippsat
  Getting top albums from last.fm ozzyk 1 3,025 Nov-19-2017, 09:40 PM
Last Post: heiner55
  Separating a string into evenly sized elements in a list kennybassett 9 6,408 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