Unit 2 - Lesson 6

20.1.1. Usage of break statement

n = int(input("n: "))
m = int(input("m: "))
for i in range(n, m):


	if(i%5 == 0):
		print(i)
		break

20.1.2. Write a program to find a given letter is a vowel or not

vowels = "aeiouAEIOU"
#Write your code here 
while True:
	c =input("vowel, or -1 to quit: ")
	if c.isalpha() or c == "-1":
		if c == "-1":
			break
		if c in vowels:
			print("vowel")
		else:
			print("not vowel")
	else:
		print("wrong input")
		continue

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.