Why isn't my variable set when I call the other function?
python
Solution
This problem also comes up when migrating to Python 3.
In Python 2 comparing an integer to `None` will "work," such that `None` is considered less than any integer, even negative ones:
>>> None > 1
False
>>> None < 1
True
In Python 3 such comparisons raise a `TypeError`:
>>> None > 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '>' not supported between instances of 'NoneType' and 'int'
>>> None < 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'NoneType' and 'int'
Problem
TypeError: '<' not supported between instances of 'NoneType' and 'int' I have looked for an answer in Stack Overflow and found that I should be taking an int(input(prompt)), but that's what I am doing ``` def main(): while True: vPopSize = validinput("Population Size: ") if vPopSize < 4: print("Value too small, should be > 3") continue else: break def validinput(prompt): while True: try: vPopSize = int(input(prompt)) except ValueError: print("Invalid Entry - try again") continue else: break ```