Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

  1. Print the initial List.  Example print("Step 2a ",xyzthings)
  2. Sort the list (you choose how you would like to sort is ascending, descending, etc. - don't care)
  3. Show the 4th element in your list
  4. Append a 6th item to the list
  5. Insert a 7th item in the list between two other items (i.e. do not append)
  6. 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

  1. How is a Method different from an Object?  Explain.  Make sure in any explanation to use your own words and provide a comprehensive answer.
  2. Find two websites that provide specific help on Lists that you found useful.  Include the URLs.
  3. 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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

Prove the combinatorial identity?

Answered: 1 week ago

Question

If M = 7, s = 2, and X = 9.5, what is z?

Answered: 1 week ago