Prime Number Python Code Logical Operator