I'm making a user input decision tree and I want to force the dictionary that the input is being compared to into lowercase. I've placed .lower() at various points and keep getting errors.
not_found = True while True: if OPTIONS == "1" or 'a': ARTIST_PICK = str(raw_input( "Please pick an artist\n" "Or Q to quit: ")).lower print ARTIST_PICK **entries = allData(filename).data_to_dict() for d in entries: arts = d['artist']** if ARTIST_PICK in arts: print "found it" elif ARTIST_PICK == 'q': break else: print "Sorry, that artist could not be found. Choose again." not_found = False This is a sample of the "entries" I'm trying to make lower and compare the user input to:
[{'album': 'Nikki Nack', 'song': 'Find a New Way', 'datetime': '2014-12-03 09:08:00', 'artist': 'tUnE-yArDs'},]
)).lowerright now. Remember to actually call the method. Try)).lower()instead. Also,if OPTIONS == '1' or 'a'doesn't do what you think it does.