Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 1193  / 3 Years ago, sun, september 19, 2021, 12:16:06

I have written a Python 3 code, which is:



i = int(input("enter number: "))
print("enter",i)


I'm expecting an output as:



enter number: 5
enter 5


However, I'm getting this:



enter number: 5
('enter', 5)


What could be the issue? How can I rectify this?


More From » python3

 Answers
3

You are using Python 2.
To use Python 3 you need to change the Python interpreter in Visual Studio Code. See instructions on Using Python Environments in Visual Studio Code
You need to go to command pallete and use python:select interpreter and select Python 3 interpreter.



In Python 3 you should get the following output.



enter number: 7
enter 7

[#3332] Sunday, September 19, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amacal

Total Points: 457
Total Questions: 102
Total Answers: 116

Location: Thailand
Member since Thu, Apr 22, 2021
3 Years ago
amacal questions
Thu, Aug 11, 22, 17:35, 2 Years ago
Thu, Apr 13, 23, 18:00, 1 Year ago
Sat, Oct 22, 22, 09:15, 2 Years ago
Mon, Aug 16, 21, 07:56, 3 Years ago
;