Problem 197370 · easy · Phase 01 Prerequisites & Setup

Conference Name Badge

strings · split · capitalize · strip

Registrations arrive typed in any case, sometimes with extra spaces at the ends. Given full_name containing exactly one first name and one last name separated by one or more spaces, return the badge text Last, First with each name capitalised (first letter uppercase, the rest lowercase).

Examples

Input:  full_name = "ada lovelace"
Output: "Lovelace, Ada"

Input:  full_name = "  GRACE   hopper "
Output: "Hopper, Grace"

Constraints

  • full_name contains exactly two words made of letters, separated and possibly surrounded by spaces

Goals

  • Split a full name into first and last parts
  • Normalise capitalisation
  • Format as `Last, First`
Starting Python…