• variables: var = value
  • dictionary: uses curly brackets
  • boolean: true/false
  • .append to add to list

data abstraction

  • can seperate lists, dictionaries
  • set variable as blank "" to add to later w get
data = [104, 101, 4, 105, 308, 103, 5, 107,
        100, 306, 106, 102, 108]    # list of the different numerical values
min_valid = 100  # minimum value
max_valid = 200  # maximum value

for x in data:
    if x > 100:
        if x < 200:
            ind = data.index(x)
            print("the index of " + str(x) + " is " + str(ind))
        else:
            continue
    else:
        continue
the index of 104 is 0
the index of 101 is 1
the index of 105 is 3
the index of 103 is 5
the index of 107 is 7
the index of 106 is 10
the index of 102 is 11
the index of 108 is 12
albums = [
    ("Welcome to my Nightmare", "Alice Cooper", 1975,   # First album list
     [
         (1, "Welcome to my Nightmare"),
         (2, "Devil's Food"),
         (3, "The Black Widow"),
         (4, "Some Folks"),
         (5, "Only Women Bleed"),
     ]
     ),
    ("Bad Company", "Bad Company", 1974,   # Second album list
     [
         (1, "Can't Get Enough"),
         (2, "Rock Steady"),
         (3, "Ready for Love"),
         (4, "Don't Let Me Down"),
         (5, "Bad Company"),
         (6, "The Way I Choose"),
         (7, "Movin' On"),
         (8, "Seagull"),
     ]
     ),
    ("Nightflight", "Budgie", 1981,
     [
         (1, "I Turned to Stone"),
         (2, "Keeping a Rendezvous"),
         (3, "Reaper of the Glory"),
         (4, "She Used Me Up"),
     ]
     ),
    ("More Mayhem", "Imelda May", 2011,
     [
         (1, "Pulling the Rug"),
         (2, "Psycho"),
         (3, "Mayhem"),
         (4, "Kentish Town Waltz"),
     ]
     ),
]

album = input("enter an album number")
song = input("enter a song number")
print(albums[int(album) - 1][3][int(song) - 1][1])
She Used Me Up