Feb-16-2020, 03:57 PM
I am new to programming -- just doing simple hand-on and input function is not working in VS Code (Anaconda). just tried same thing in Juptyr notebook and it responds as expected.
1st Code with issues
replicating part of code:
while same is giving no results in VS code - below is the snippet I get in output terminal after I execute these statement:
2nd Code with issues
while same is throwing error in VS Code:
1st Code with issues
replicating part of code:
import sys print ("enter your name ") x= input () print ("hello ", x)## This is asking for input and printing correct result in Jupyter notebook--
while same is giving no results in VS code - below is the snippet I get in output terminal after I execute these statement:
Output:enter your name
>>> x= input ()
print ("hello ", x)
## It is not asking me to enter the name##2nd Code with issues
r = int (input ("enter a number")) print (r*2)giving correct output in Jupyter
while same is throwing error in VS Code:
r = int (input ("enter a number")) print (r**2)
Error:Error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: 'print (r**2)'
>>>
Please support to resolve, TIA!