Question
Create a single program that completes the following. You will be submitting your finished program. 1. Create a List variable that will contain 5 items
Create a single program that completes the following. You will be submitting your finished program.
1. Create a List variable that will contain 5 items in the same category. The items should be something unique to you that you like. The items could be names of foods, bands, songs, places, animals, etc. - your list should be unique to you. Name the variable xyzthings (where xyz are your initials). Your items cannot be numbers, single characters, abbreviations, etc.
2. Have your program do the following and print the results of each step. Include a description of what is being printed.
- Print the initial List. Example print("Step 2a ",xyzthings)
- Sort the list (you choose how you would like to sort is ascending, descending, etc. - don't care)
- Show the 4th element in your list
- Append a 6th item to the list
- Insert a 7th item in the list between two other items (i.e. do not append)
- Remove the 4th item from your list
2. Answer the following questions: Note - Make sure you watch the YouTube https://www.youtube.com/watch?v=ohCDWZgNIU0&t=3s
- How is a Method different from an Object? Explain. Make sure in any explanation to use your own words and provide a comprehensive answer.
- Find two websites that provide specific help on Lists that you found useful. Include the URLs.
- How can you determine what methods are available that manipulate Lists, from within Python?
Turn in: Each assignment will list the specifics of what should be turned in. Pay attention to the directions and format.
Submit the following two files
- Your Python script text file. The naming convention for lab files is: LabX_ABC.py - where X is the Lab number and ABC are your initials
- A single MS Word document that contains:
- Screenshot of output from final script run (from your .py file)
- Answers to the questions above
Step by Step Solution
3.35 Rating (155 Votes )
There are 3 Steps involved in it
Step: 1
Step 1 Create a List variable with 5 items xyzthings Pizza Guitar Mountains Elephant Choc...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