Single Line For Loop With If Statement Python