Using while loop and If statements, print all the letters in the following string except for the letter ‘g’ and ‘o'.Sentence is ‘goodbyemybaloon’. Use break and continue in program as well.
s = "goodbyemybaloon"
i = 0
while True:
if i == len(s):
break
l = s[i]
i += 1
if l in "go":
continue
else:
print(l)
Comments
Leave a comment