Generate Employee Initials

Easy ⏱ 8 min 77% acceptance ★★★★★ 4.7
Write initials(names) that turns each full name (two or more words) into its uppercase initials joined by dots, e.g. 'Rahul Kumar''R.K', using a comprehension (an inner join over the split words).

Examples

Example 1
Input
initials(['Rahul Kumar', 'priya n sharma'])
Output
['R.K', 'P.N.S']
Explanation

First letters of every word, uppercased, dot-joined.

Constraints

  • Handle any number of words per name.
  • Uppercase the initials.

Topics

List Comprehensionsstring split

Companies

InfosysHCLTechWipro

Hints

Hint 1

'.'.join(...) can consume a generator of first letters.

Hint 2

w[0].upper() for w in name.split().

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.