Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.55 KB

README.md

File metadata and controls

36 lines (28 loc) · 1.55 KB

Python List and String Exercises - Solution Repository

Welcome to the solution repository for the Python List and String Exercises! This repository contains solutions for four assignments designed to help you practice working with lists and strings in Python.

Repository Contents

This repository is organized into four main sections, each corresponding to a different set of exercises:

  1. Basic List Exercises

    • File: list1_solution.py
    • Exercises include:
      • match_ends: Count strings with matching start and end characters.
      • front_x: Group and sort strings starting with 'x'.
      • sort_last: Sort a list of tuples based on their last element.
  2. Additional Basic List Exercises

    • File: list2_solution.py
    • Exercises include:
      • remove_adjacent: Remove adjacent duplicate elements from a list.
      • linear_merge: Merge two sorted lists into one sorted list.
  3. Basic String Exercises

    • File: string1_solution.py
    • Exercises include:
      • donuts: Return a string describing the number of donuts.
      • both_ends: Return a string made of the first and last two characters.
      • fix_start: Replace all occurrences of the first character in a string.
      • mix_up: Swap the first two characters of two strings.
  4. Additional Basic String Exercises

    • File: string2_solution.py
    • Exercises include:
      • verbing: Add 'ing' or 'ly' to a string based on its ending.
      • not_bad: Replace 'not'...'bad' with 'good' in a string.
      • front_back: Combine two strings by their halves.