Skip to content

Conversation

@github-actions
Copy link

Description

Added some comments explaining the code.

Fixed the consonant printing.

Improved the message that is printed out.

Tested with the following strings:

abcdefghijklmnopqrstuvwxyz
Welcome to the Jungle 1234

Fixes issue

Fixes #7 python

def num_vowels(text):
"""Return the number of vowels in string."""
vowels = "aeiou"
vowels = "aeiouy"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y is both a consonant and value, so the definition of vowel should be clarified

num += text.lower().count(v)
return num

def num_consonants(text):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstrings could be added to describe what the function is doing

for letter in text:
if letter not in vowels:
print("consonant", letter)
num += text.lower().count(letter)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about numbers? I don't think numbers should be counted as consonants, but they were counted when I tested the script

Copy link
Owner

@jarbesfeld jarbesfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python: Exercise 1

3 participants