Q. Given a string S, write expressions to print
(i) First five characters of S
(ii) Ninth character of S
(iii) Reversed S
(iv) Alternate characters from reversed S
Answer =
(i) S [ : 6]
(ii) S [ 9 : 10]
(iii) S [-1 : : -1]
(iv) S [len(S) : : -1 ]
Thank you so much🙂
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )