Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1. Write a program that does the following: (Python) Create a list with the exact following elements: (You could first create a string with

Exercise 1. Write a program that does the following: (Python)

  1. Create a list with the exact following elements: (You could first create a string with all the movies' names below, then use split(', ') to create a list -- notice that I use ', ' with a space after the comma)

     black panther, bohemian rhapsody, the favourite, green book, roma, a star is born, vice, can you ever forgive me?, the favourite, first reformed, green book, roma, vice, if beale street could talk, a star is born, incredibles 2, isle of dogs, mirai, ralph breaks the internet, spider-man: into the spider-verse, cold war, the favourite, never look away, roma, a star is born, the ballad of buster scruggs, black panther, the favourite, mary poppins returns, mary queen of scots, avengers: infinity war, christopher robin, first man, ready player one, solo: a star wars story, black panther, bohemian rhapsody, first man, a quiet place, roma, animal behaviour, bao, late afternoon, one small step, weekends, free solo, hale county this morning, this evening, minding the gap, of fathers and sons, rbg, black sheep, end game, lifeboat, a night at the garden, period. end of sentence., the favourite, mary poppins returns, mary queen of scots, avengers: infinity war, christopher robin, first man, ready player one
  2. Remove duplicated names from the list

  3. Sort the names of the movies in the list in alphabetical order

  4. Modify the elements of the list so that all movies' names are in title case with the following restrictions:

    • First letter of each word is capitalized,
    • Except for the words the, a/an, of, at, on, in -- these should stay all lowercases,
    • But if these words are the first word in the name of any movie, then their first letter should be capitalized

The output of the program should be a list with all the movies' names (no duplicates), listed in alphabetical order and formatted in title case, with the restrictions listed in number 4.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

e. What difficulties did they encounter?

Answered: 1 week ago