Posts

PYTHON_LEARNING_DUMP

Image
   # using while loop  a=10 count=0 while count<a :   count = count+1   print (count) -------------------------------------------------------------------------------------------------- #count total number of spaces, vowels and consonants in the given string string = input("ENTER THE STRING:\n") length= len(string) print(f"total length of given string is: {length}") #number of vovel vowel="aeiou" vow_count=0 cons = "bcdfghjklmnpqrstvwxyz" cons_count=0 space=" " space_count=0 string=string.lower() for i in string:  if i in cons:   cons_count = cons_count+1    elif i in vowel:   vow_count = vow_count+1    elif i in space:   space_count = space_count+1 print(f"Total number of spaces in the given string is: {space_count}") print(f"Total number of consonants in the given string is: {cons_count}") print(f"Total number of vowels in the given string is: {vow_count}") ----------------------------------------------...