Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vow = list("aeiouAEIOU")
- numbers = list("1234567890")
- consonant = list("bcdfghjklmnprstvxzBCDFGHJKLMNPRSTYXZ")
- alfanumerice = list('abcdefghijklmnopqrstuvxywzABCDEFGHIJKLMNOPQRSTUVXYWZ0123456789ăîâșțĂÎÂȘȚ,.-')
- def count_characters(input_text):
- characters = len(input_text)
- return characters
- def count_vow(input_text):
- vow_count = 0
- for letter in input_text:
- if letter in vow:
- vow_count += 1
- return vow_count
- def count_consonant(input_text):
- consonant_count = 0
- for letter in input_text:
- if letter in consonant:
- consonant_count += 1
- return consonant_count
- def count_alpha(input_text):
- alpha_count = 0
- for letter in input_text:
- if letter in alfanumerice:
- alpha_count += 1
- return alpha_count
- def count_numbers(input_text):
- numbers_count = 0
- for letter in input_text:
- if letter in numbers:
- numbers_count += 1
- return numbers_count
- def count_words(input_text):
- words = input_text.split()
- return len(words)
- def print_results(input_text):
- print("Total cuvinte in text: " + str(count_words(input_text)))
- print("Total simboluri: " + str(count_characters(input_text)))
- print("In total consoane sunt " + str(count_consonant(input_text)))
- print("In total vocale sunt " + str(count_vow(input_text)))
- print("In total numere sunt " + str(count_numbers(input_text)))
- print("In total alfanumerice sunt " + str(count_alpha(input_text)))
- text = input("Indicati un text: ")
- print_results(text)
- text1 = input("Text1= ")
- print_results(text1)
- text2 = input("Text2= ")
- print_results(text2)
- text3 = input("Text3= ")
- print_results(text3)
- text4 = input("Text4= ")
- print_results(text4)
Advertisement
Add Comment
Please, Sign In to add comment