Skip to the content

Initials

Problem

Write a function that takes a first name and a last name (each one with at least one letter) and returns their initials in capitals, each one with its period: with "alan" and "turing" it returns "A. T.".

Examples

  • "Grace", "Hopper" → "G. H."

  • "alan", "turing" → "A. T."

  • "Ada", "Lovelace" → "A. L."

Besides these, the challenge has hidden tests that are revealed when you submit your solution.

You start with this

Python

def initials(first, last):
    pass

JavaScript

function initials(first, last) {
}
Solve this challenge

It opens in your browser, with the editor and the tests. It is free and you do not need an account to start.

More O(1) challenges

See all challenges →