MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / main

Function main

dynamic_programming/fibonacci.py:27–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26
27def main() -> None:
28 print(
29 "Fibonacci Series Using Dynamic Programming\n",
30 "Enter the index of the Fibonacci number you want to calculate ",
31 "in the prompt below. (To exit enter exit or Ctrl-C)\n",
32 sep="",
33 )
34 fibonacci = Fibonacci()
35
36 while True:
37 prompt: str = input(">> ")
38 if prompt in {"exit", "quit"}:
39 break
40
41 try:
42 index: int = int(prompt)
43 except ValueError:
44 print("Enter a number or 'exit'")
45 continue
46
47 print(fibonacci.get(index))
48
49
50if __name__ == "__main__":

Callers 1

fibonacci.pyFile · 0.70

Calls 2

getMethod · 0.95
FibonacciClass · 0.85

Tested by

no test coverage detected