I'm trying to write a text game with what I've learned so far, but I ran into a problem. 

When I input 1, it's fine, but when I input 2, it gives me the following error:

```
Traceback (most recent call last):
  File "ex36.py", line 39, in <module>
    start()
  File "ex36.py", line 27, in start
    if choice == 1 or "closer" in choice:
TypeError: argument of type 'int' is not iterable

```

I realize that the function idf(): is totally unnecessary as I can just treat the input 2 as a string without converting it into an integer. This fixes the program. However, I would like to know why this error occurs when I try to change the input into a string, and why it only works for 1 and not 2.

I'm sorry for this stupid question; I'm very new to programming and trying to teach myself python. Thanks for the support, everyone. 

**Update 1:**
I think I see the problem now, as pointed out by two answerers below. The problem happens when the program tries to check "closer", which is a string, in choice, which is an integer.

I would like the if statements to accept both integers and strings. How would I do this? Any advice to modify my program? 

```
from sys import exit

print("""Welcome to my text game! You may input numbers (e.g. 1, 2, 3) to
navigate or type in your choice.""", "\n")

def bad_news(reason):
    print(reason)
    exit(0)

#IDs if str or int
def idf(check):
    if check.isdigit() == True:
        converted = int(check)
        return converted
    else:
        return check

def start():
    print("You're walking home down a dark road, in a dark and gloomy night.")
    print("There's someone going the same way as you.")
    print("'It's quite dark and dangerous,' you think. 'Better do something.'")
    print("Will you: 1. Follow him/her closer? or 2. Keep distance?")
    choice1 = input("> ")

    choice = idf(choice1)

    if choice == 1 or "closer" in choice:
        bad_news("""The person gets spooked and you got cops called on you.
Now you have a restraining order. Great!""")
    elif choice == 2 or "distance" in choice:
        alley()
    else:
        print("The input is invalid; please try again.")
        start()

def alley():
    print("Now in alley.")

start()

```