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.
This repository is organized into four main sections, each corresponding to a different set of exercises:
-
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.
- File:
-
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.
- File:
-
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.
- File:
-
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.
- File: