Answer to Question #188162 in Python for naomi

Question #188162

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.

1
Expert's answer
2021-05-05T06:18:13-0400
s = "goodbyemybaloon"
i = 0
while True:
	if i == len(s):
		break
	l = s[i] 
	i += 1
	if l in "go":
		continue
	else:
		print(l)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS