My vscode terminal does not display the result

Asked

Viewed 795 times

0

Good afternoon! I am learning Python in Windows environment and in an example my terminal does not show the desired result.

inserir a descrição da imagem aqui

When I run the code through the terminal it opens another window asking for the radius (input). When I put any number it closes and does not report the result.

Code:

#! python
from math import pi

raio = input('Informe o raio: ')

print('A area do ciruculo eh ', pi * float(raio) ** 2)
  • replace image with code so we can replicate your example

1 answer

0


The correct way to execute your code would be to invoke python before the script you want to run, so we would have:

python main.py

We are assuming that the name of the file you want to run is main.py.

Exit:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\pessoal> python main.py
Informe o raio: 1
A area do ciruculo eh  3.141592653589793
PS C:\Users\pessoal> 

Browser other questions tagged

You are not signed in. Login or sign up in order to post.