Learning conditionals inside while loops