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
parameterandreturnsa list containing the firstnterms of the Fibonacci sequence. - Print the
generatedFibonacci sequence.
Example code is here
- Prompts a user to enter their
age. - Uses a conditional statement to check if the
ageisgreater thanorequal to18. - Prints
You are eligible to voteif true, otherwiseYou are not eligible to vote