Write a Python Program to Accept a String And Count The Frequency of Each Vowel

preview_player
Показать описание
Hello Programmers, Welcome to my channel.

In this video you will learn about how to Write a Python Program to Accept a String And Count The Frequency of Each Vowel

Python Scripts
======================

Python Functions Solved
==========================

Python Programs Solved
============================

Code
=============================

vowels = "aeiou"
my_dictionary = {}.fromkeys(vowels, 0)

my_string = input("Enter a string : ").lower()
for letter in my_string:
if letter in my_dictionary:
my_dictionary[letter] += 1

print(f"Vowel : {key} occurs : {value} times")

Keywords
=============================
#python #python3 #python_assignment #pythonprogramming #pythontutorial #pythonprojects #pythoncourse #pythonbaba #pythonforbeginners #pythonautomation #pythonbasic #pythonbeginners
Рекомендации по теме
Комментарии
Автор

Hello,
Can you help me please. I'm stuck.
Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase words should take precedence over lowercase words. For example, 'Z' comes before 'a'.

The input file can contain one or more sentences, or be a multiline list of words.

An example input file is shown below:

example.txt

the quick brown fox jumps over the lazy dog

An example of the program's output is shown below:

Enter the input file name: example.txt

brown
dog
fox
jumps
lazy
over
quick
the

This is the coding I have but it keep saying Program output test 1 and 2 incomplete.
file_name = input("Enter the input file name: ")

file_obj =open(file_name)
uniqueWords = []

for line in file_obj:
words= line.split()
for curr_word in words:
curr_word= curr_word.strip(', .?!')
if curr_word not in unique_words:

file_obj.close()
unique_words.sort()

print()

for curr_word in unique_words:
print(curr_word)

SWEETPEALIPS
welcome to shbcf.ru