diff --git a/conditions.py b/conditions.py index 8ff3d8e..08fcb50 100644 --- a/conditions.py +++ b/conditions.py @@ -1,20 +1,7 @@ -# Python Conditional Statements -#example is https://plpacademy.powerlearnproject.org/course-module/62fbec9d28ac4762bc524f92/week/62fe1efd28ac4762bc524f9c/lesson/62fe1fbd28ac4762bc524f9f - - - -# Create a Python program that: - - -# - 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." - - - +# Prompt the user to enter their age age = int(input("Enter your age: ")) - +# Check if the user is eligible to vote if age >= 18: print("You are eligible to vote.") else: diff --git a/functions.py b/functions.py index c80ee3c..2f343a9 100644 --- a/functions.py +++ b/functions.py @@ -23,10 +23,10 @@ def fibonacci(n): return fibonacci_sequence # Get the number of terms from the user -num_terms = int(input("Enter the number of terms: ")) +num_terms = int(input("Enter the number of terms for the Fibonacci sequence: ")) # Generate the Fibonacci sequence fibonacci_sequence = fibonacci(num_terms) # Print the Fibonacci sequence -print(fibonacci_sequence) +print("Fibonacci sequence up to term", num_terms, ":", fibonacci_sequence)