Gas96 commited on
Commit
70572a6
·
verified ·
1 Parent(s): c9b618a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -35,14 +35,14 @@ def fibonacci(n: str) -> str:
35
  # Initialize the Fibonacci sequence
36
  fib_sequence = [0, 1]
37
 
38
- if n > 30:
39
- n=30
40
  # Generate Fibonacci numbers up to n
41
  for i in range(2, n):
42
  fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])
43
 
44
  # Return the sequence as a string
45
- return f"The Fibonacci series up to the {n}th number (but not higher than 30) is: {', '.join(map(str, fib_sequence))}"
46
 
47
  except Exception as e:
48
  return f"Sorry, there was an error generating the Fibonacci series: {e}"
 
35
  # Initialize the Fibonacci sequence
36
  fib_sequence = [0, 1]
37
 
38
+ if n > 2000:
39
+ n=2000
40
  # Generate Fibonacci numbers up to n
41
  for i in range(2, n):
42
  fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])
43
 
44
  # Return the sequence as a string
45
+ return f"The Fibonacci series up to the {n}th number (but not higher than 2000) is: {', '.join(map(str, fib_sequence))}"
46
 
47
  except Exception as e:
48
  return f"Sorry, there was an error generating the Fibonacci series: {e}"