Skip to the content

The username

Problem

When you sign up you type your name and the app hands you a number. The username is the name in lowercase, an underscore and the number: with "Ann" and 7 you return "ann_7".

The name arrives with no extra spaces and has at least one letter; the number can be 0.

Examples

  • "Ann", 7 → "ann_7"

  • "PETER", 21 → "peter_21"

  • "lucy", 3 → "lucy_3"

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

You start with this

Python

def username(name, num):
    pass

JavaScript

function username(name, num) {
}
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 →