100. Python Program to Print the First and Last Character of a String
EasyIndex and slice
Overview
Use string indexes, including a negative one, to pick single characters.
Problem Statement
Read a word (or a short sentence) and print its first character and its last character, each on its own line. For example, for Sunny:
First: S
Last: y
Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.
Input
One line of text. Example:
Sunny
Output
The output for that example:
First: S
Last: y
The tests try 4 different inputs, including a one-letter word.