Question
Turtle Control and Lists Introduction Part A Fun with lists (lab5_XX.py): In this lab you will be creating a number of different functions to create
Turtle Control and Lists Introduction
Part A
Fun with lists (lab5_XX.py):
In this lab you will be creating a number of different functions to create and manipulate lists.
You will be using the Python IDLE (a Python editor and programming environment that comes with python). Name your file lab5_XX.py where you replace the XX with your initials.
Your program must include:
A comment on the top line of your program containing your name.
A comment on the second line containing your section number.
A comment on the third line containing the date.
A comment on the fourth line containing your email address.
A comment with the lab number and purpose of this lab.
Declare a function with one parameter to create a list of X elements (numbering from 1 to X) and then output this list to the screen.
Declare a function with two parameters (X and Y) to create a list of X elements where the elements count by Y. For example, if X = 4 and Y = 3, you should create the following list [3, 6, 9, 12]. You will then need to output this list to the screen.
Declare a function with one parameter X that creates a list of X elements (numbering from 1 to X). You will then remove the last element of the list and print the updated list repeatedly until only one element in the list remains. At this point you will output the remaining list (consisting of the one element) and a message saying that that is the last one.
Include code in your .py file to execute each of the above three functions once each. To execute each function, you should prompt the user for whatever values the function requires, then call the function with the user's values.
Output a message to the user thanking them from using your program that includes your first and last name.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started