+ 2

How to know first alphabet , middle alphabet and last alphabet from a string ?

input : any string with len even output : (first alphabet) (middle alphabet) (last alphabet) please help me guys

10th Oct 2017, 4:51 PM
D' Ravelens
D' Ravelens - avatar
1 Odpowiedź
0
My_string ="hello"; Length=len(My_string); print(My_string[0]); print(My_string[Length-1]); print(My_string[Length//2]);
10th Oct 2017, 5:39 PM
Chinmoy
Chinmoy - avatar