I have the following code but I can't seem to get the program working in Visual Studio. I need to configure the interpreter arguments within the build settings to get the program to work.
How do I configure the interpreter / script arguments in Visual Studio for this Python program?
import sys
def Fib(limit):
"""
Lager en liste med fibonacci tall
"""
fib = [1]
second_last = 0
last = 1
for i in range(limit - 1):
second_last, last = last, last + second_last
fib.append(last)
return fib
if __name__ == "__main__":
limit = int(sys.argv[1])
if (limit < 0):
print("Kan ikke bruke negative tall")
sys.exit()
fibs = Fib(limit)
for elem in Fibs:
#print (elem)
sys.stdout.write(" {} ".format(elem))
sys.stdout.write("\n")