Python Devlopment






vowels



#String Formating
from time import localtime
def print_date():
	week = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sun" ]
	year = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
	t = localtime()
	fmt = "%s %s %d %02d:%02d:%02d IST %d"
	day = week[t.tm_wday]
	mon = year[t.tm_mon - 1]
	print fmt % (day, mon, t.tm_mday, t.tm_hour, t.tm_min,t.tm_sec, t.tm_year)
    	
#Write a Python program to count and display the vowels of a given text.
def vowel(st):
    	vowels=0
	for i in string:
		if(i=='a' or i=='e' or i=='i' or i=='o' or i=='u' or i=='A' or i=='E' or i=='I' or i=='O' or i=='U'):
        		vowels=vowels+1
	print("Number of vowels are:")
	print(vowels)	
	#vowels = "aeiuoAEIOU"
    	#print(len([letter for letter in text if letter in vowels]))
    	#print([letter for letter in text if letter in vowels])

c=1
while(c==1):
	print"1.Print Current Date in Specific Format"
	print"2.Count Vowels"
	print"Enter your choice : "
	choice=input()
	if choice==1:
		print"Today's date and time is : "
		print_date()
	elif choice==2:
		string=raw_input("Enter a string : ")
		vowel(string);
	else:
		print("Wrong choice")
	
	print("\n\nDo you want to continue (1-Continue/0-Discontinue) : ")
	c=input()

print"Succesful!"