I am new to Linux. Currently I am using WSL(Ubuntu). In my virtual environment this code does not work, but on online IDE the same code works. I have installed latest version of python into my virtual environment.
word_one = input("Enter the first word:") #input mark
word_two = input("Enter the second word:") #input mary
# if element
if word_one > word_two:
print(word_two,word_one)
else:
print(word_one,word_two)
to execute
python test.py
Traceback (most recent call last):
File "test.py", line 1, in <module>
word_one = input("Enter the first word:")
File "<string>", line 1, in <module>
NameError: name 'mark' is not defined
update: even after installing the latest version of python into my virtual environment, it was still running as python2, so whenever I do "python test.py" it was running the python script using old version. To solve this I had to use "python3 test.py" and it was working good.
Question?
is there a way where I can make python3 as my default execution, so whenever I type
"python test.py" it can run using latest version?