what do I do to prompt for an input by the user with the following function?
Can I use user = input("please enter number") in this function.
def Func(x):
total = 0
for i in range(x):
total += i * (i-1)
return total
so adding it to the function would be like
def Func(x):
user = input("please enter number: ")
x=user
total = 0
for i in range(x):
total += i * (i-1)
return total
Once you define the function, you can subsequently invoke it: