Thanh Danh Pham
Thanh Danh Pham

Reputation: 1

Why I can not enter output value in the output console in Visual Studio Code

My python code in Visual Code Studio is having some problems:

def calculate(n):
    sum = (n*(n+1))/2
    return sum


in_value = int(input(">"))
answer = int(calculate())
print(answer)

But I can not enter the input value in the output console: Why does that happen ? Thanks for answering

Upvotes: 0

Views: 155

Answers (1)

muratkk
muratkk

Reputation: 21

You are not passing the in_value into calculate() function.

answer = int(calculate(in_value)) 

Upvotes: 2

Related Questions