string = "Premier League is the best league"
string2 = "The match was intense and thrilling"
print("String 1: Premier League is the best league")
length = len(string)
print("Length:", length)
def count_vowels(input_string):
vowels = 'aeiouAEIOU'
count = 0
for char in input_string:
if char in vowels:
count += 1
return count
print("Vowel Count:", count_vowels(string))
def average_word_length(input_string):
words = input_string.split()
if not words:
return 0
total_length = sum(len(word) for word in words)
average_length = total_length / len(words)
return average_length
print("Average Word Length:", average_word_length(string))
def palindrome(input_string):
string = input_string.replace(" ", "").lower()
return string == string[::-1]
print("Palindrome or Not?", palindrome(string))
# For the second string
print("String 2: The match was intense and thrilling")
length2 = len(string2)
print("Length:", length2)
print("Vowel Count:", count_vowels(string2))
print("Average Word Length:", average_word_length(string2))
print("Palindrome or Not?", palindrome(string2))
String 1: Premier League is the best league
Length: 33
Vowel Count: 14
Average Word Length: 4.666666666666667
Palindrome or Not? False
String 2: The match was intense and thrilling
Length: 35
Vowel Count: 9
Average Word Length: 5.0
Palindrome or Not? False