Phase 6 - Category 2: Array & String Combinations
Combine array and string operations to solve complex problems.
10 programs · open one, then the next
Start with Convert Array to String- 01Convert Array to StringIntermediateJoin integer list values into one Python string. Students convert each value before join and understand why a separator-free representation can lose boundaries.Open example →py# Take array n = int(input("Enter array size: ")) arr = [] for i in range(n):
- 02Convert String to Array of DigitsIntermediateConvert digit characters in mixed text into a integer list. Students follow a filtered comprehension and distinguish individual digits from whole-number runs.Open example →py# Take string s = input("Enter a string of digits: ") # Convert to array
- 03Count Vowels in Array of StringsIntermediateCount English vowels across a Python list of strings. Students trace outer and inner traversals and keep a single total across every input string.Open example →py# Take array of strings n = int(input("Enter number of strings: ")) arr = [] for i in range(n):
- 04Find Longest String in ArrayIntermediateChoose the longest string in a Python list using max with key=len. Students include spaces in length and handle tied maxima or an empty collection explicitly.Open example →py# Take array of strings n = int(input("Enter number of strings: ")) arr = [] for i in range(n):
- 05Array of Palindrome StringsIntermediateFilter palindrome strings from a Python list. Students compare exact reversals and preserve repeated matches while keeping case and whitespace significant.Open example →py# Take array of strings n = int(input("Enter number of strings: ")) arr = [] for i in range(n):
- 06Sum of Numbers in Array of StringsAdvancedSum digit runs found across multiple strings. Students reset a per-string buffer, keep a shared total, and flush trailing numbers before moving to the next text.Open example →py# Take array of strings n = int(input("Enter number of strings: ")) arr = [] for i in range(n):
- 07Common Characters in Array of StringsAdvancedFind characters common to every string in a list. Students initialize a set from the first string and progressively intersect it with each later character set.Open example →py# Take array of strings n = int(input("Enter number of strings: ")) arr = [] for i in range(n):
- 08Sort Strings by LengthIntermediateSort a Python list of strings by increasing length. Students use key=len, retain input order for equal lengths, and create a new list without altering arr.Open example →py# Take array of strings n = int(input("Enter number of strings: ")) arr = [] for i in range(n):
- 09Count Total Words in Array of StringsIntermediateCount words across a Python list of strings. Students split each text independently, ignore empty whitespace tokens, and accumulate counts across the inputs.Open example →py# Take array of strings n = int(input("Enter number of strings: ")) arr = [] for i in range(n):
- 10Concatenate Array of StringsBeginnerConcatenate a list of strings with an empty join separator. Students preserve each string's content and see why no new spaces appear between list entries.Open example →py# Take array of strings n = int(input("Enter number of strings: ")) arr = [] for i in range(n):