Python Use Variable In Nested Ifs In Python List