Code that works on both 2 and 3
import platform
def my_input(text):
if platform.python_version_tuple()[0] == 3:
return input(text)
else:
return raw_input(text)
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
import platform
def my_input(text):
if platform.python_version_tuple()[0] == 3:
return input(text)
else:
return raw_input(text)