Python · 575 bytes Raw Blame History
1 #!/usr/bin/env python
2 """Test file for syntax highlighting in fac"""
3
4 def fibonacci(n: int) -> int:
5 """Calculate the nth Fibonacci number"""
6 if n <= 1:
7 return n
8 return fibonacci(n - 1) + fibonacci(n - 2)
9
10 class Calculator:
11 def __init__(self):
12 self.result = 0
13
14 def add(self, x: float, y: float) -> float:
15 # Add two numbers
16 self.result = x + y
17 return self.result
18
19 # Test the functions
20 if __name__ == "__main__":
21 print("Fibonacci of 10:", fibonacci(10))
22 calc = Calculator()
23 print("5 + 3 =", calc.add(5, 3))