Write a Python program to generate the Fibonacci sequence up to a specified term n. The Fibonacci sequence starts with 0 and 1, and each subsequent term is the sum of the two preceding terms.
- Ask the user to input the value of
n
. - Create a function that takes n as a
parameter
andreturns
a list containing the firstn
terms of the Fibonacci sequence. - Print the
generated
Fibonacci sequence.
Example code is here
- Prompts a user to enter their
age
. - Uses a conditional statement to check if the
age
isgreater than
orequal to
18. - Prints
You are eligible to vote
if true, otherwiseYou are not eligible to vote