I am making a script that takes a string input. However, I want this script to be independent of python 2.7 or python 3+.
For python 2.7 I write
name = raw_input("Enter your name: ")
For python 3+ I write
name = input("Enter your name: ")
How can I write a single line of code that will be compatible with both the version ?