Question: The program I am writing allows you to input any number and the program will identify if the number is a prime number or not. However, I am getting an error as shown below.

I have been having trouble with this line of my code:

```
chosen = input("Input a number")
number = (chosen) / chosen

```

When I run it, here is the output:

```
Input a number1
Traceback (most recent call last):
File "C:\Users\engineer2\Desktop\Programs\prime numbers.py", line 3, in <module>
number = (chosen) / chosen
TypeError: unsupported operand type(s) for /: 'str' and 'str'

```

Here is the full code:

```
chosen = input("Input a number")
number = (chosen) / chosen
one = 1
if number == (one):
print ("Its a prime number")

else:
print ("Not a prime")

input ("press enter")

```

Answer: 
You're trying to divide strings, convert to an int using `int()`. 

```
try:
    chosen = int(input("Input a number"))
except ValueError:
    print('Not number.')

```

As a side-note, your algorithm for [checking primality](https://en.wikipedia.org/wiki/Primality_test) is flawed, you need to check every number in the range of your number for no remainder division with `n` not just the **input**.

```
a = int(input("Input a number: "))  # Example -> 7
def is_prime(n):
    for i in range(2, n):   
        if n % i == 0: 
            return False
    return True

print is_prime(a)
>>> True

# One-liner version.
def is_prime(n):
    return all(n % i for i in range(2, n))

print is_prime(a)
>>> True

```
`input()` function returns a `string` instead of an `int`. Try converting it or using `raw_input()` instead:

Method 1:

```
chosen = int(input("Input a number"))
number = (chosen) / chosen

```

Method 2:

```
chosen = raw_input("Input a number")
number = (chosen) / chosen

```