Computer Science, asked by Ragul0000, 5 months ago

Find and write the output : 3 String=input(“Enter the String:”) Count=5 while True: if string[0]==’c’ string=string[2:] elif string[-1]==”d” string=string[:2] else: Count+=1 Break Print(string) Print(count)

Answers

Answered by prerna7313
0

Answer:

relevant to your question

Explanation:

def string_both_ends(str):

if len(str) < 2:

return ''

return str[0:2] + str[-2:]

print(string_both_ends('w3resource'))

print(string_both_ends('w3'))

print(string_both_ends('w'))

Similar questions