diff --git a/conditions.py b/conditions.py index 1499e63..9028d24 100644 --- a/conditions.py +++ b/conditions.py @@ -9,3 +9,9 @@ # - Prompts a user to enter their age. # - Uses a conditional statement to check if the age is greater than or equal to 18. # - Prints "You are eligible to vote" if true, otherwise "You are not eligible to vote." +age = input('Enter your age: ') + +if int(age) >=18 : + print('You are eligible to vote') +else: + print('You are not eligible to vote') diff --git a/functions.py b/functions.py index 0d458e4..ba1da55 100644 --- a/functions.py +++ b/functions.py @@ -12,14 +12,15 @@ def fibonacci(n): Returns: A list containing the Fibonacci sequence up to n terms. """ + if n <= 1: - # Complete here + return n else: - a, b = # complete here + a , b = 0 , 1 for _ in range(2, n + 1): c = a + b - # Complete here - return # add the variable to be returned + a , b = b , c + return c # Get the number of terms from the user num_terms = int(input("Enter the number of terms: "))