Need help with python coding 1 Road a string: s . input() 3- Printstring print(s
ID: 3729494 • Letter: N
Question
Need help with python coding
1 Road a string: s . input() 3- Printstring print(s) Statement stri the first and the last cceanence of rhe lettey h AR welt AA Griven 2 string in which the letter h ecurs ar lenat twice Remove from that all the characters between them Example input In the hole in the ground there lived hobbit Example output In tobbit Theory [f you don't know bow to steri golv til: dns 88stummtil, plenu, ,eview "on y rut lans lessm. lessons strings You may alao try, krep-hy-kte theory chinks. htpallanalcify.org lessons strings str'stepa/l Python 3.6.1 (delault, Dec 2815, 13:85:11) 4.2.2] on I1nuxExplanation / Answer
s = input() start = -1 end = -1 for i in range(len(s)): if s[i] == 'h': if start == -1: start = i else: end = i s = s[:start] + s[end+1:] print(s)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.