Reputation: 1
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
Reputation: 21
You are not passing the in_value into calculate()
function.
answer = int(calculate(in_value))
Upvotes: 2