Loading...
Loading...
Loading...
A form needs the first and the last letter of a customer's code. Read one word and print its first letter and its last letter on one line, with a space between them.
A one-letter word prints that letter twice.
Example
Input
Mentor
Output
M r
The first letter is M and the last is r.
Try the problem first. Open one hint at a time.
Index 0 is the first character. A negative index counts from the end.
Print word[0] and word[-1] in one print call, so the space comes for free.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor