python and ifs