Founding Batch Offer · HLD · LLD · System Design at ₹799 until 30 Nov

ProgramsLogic building

Phase 5 - Category 3: Word Operations

Master word-level string operations.

10 programs · open one, then the next

Start with Print First Word
  1. 01Print First WordBeginnerPrint the first whitespace-separated word safely with Python. Students use split before indexing and handle blank or space-only responses without an IndexError.Open example →
  2. 02Print Last WordBeginnerPrint the last whitespace-separated word with Python. Students combine split, an empty-input guard, and negative indexing while retaining attached punctuation.Open example →
  3. 03Reverse Order of WordsIntermediateReverse token order with Python split, list slicing, and join. Students follow the three-stage word pipeline and see how extra whitespace becomes single spaces.Open example →
  4. 04Find Longest WordIntermediateChoose the longest whitespace-separated word with max and key=len. Students compare word lengths rather than alphabetic values and handle a tie or empty input.Open example →
  5. 05Find Shortest WordIntermediateFind the shortest token with Python min and key=len. Students guard empty input, compare lengths, and predict first-occurrence behavior when several words tie.Open example →
  6. 06Capitalize First Letter of Each WordIntermediateApply title casing to entered text. Students inspect uppercased starts, lowercased remaining letters, and why title is not simply a first-letter-only operation.Open example →
  7. 07Swap First and Last WordIntermediateSwap the first and last words in Python while retaining middle-word order. Students split text, require two tokens, and rebuild the result with single spaces.Open example →
  8. 08Count Words Starting with VowelIntermediateCount words beginning with English vowels using Python. Students split whitespace and test the first character, including uppercase and punctuation cases.Open example →
  9. 09Remove Duplicate WordsIntermediateRemove duplicate words while preserving first appearances with Python. Students combine a seen set and output list and understand case-sensitive token equality.Open example →
  10. 10Sort Words AlphabeticallyIntermediateSort whitespace-separated words using Python's default string ordering. Students compare a sorted copy with the token order and recognize case-sensitive results.Open example →