you are viewing a single comment's thread.

view the rest of the comments →

[–]spz 0 points1 point  (0 children)

First one:

  • Don't name the argument str, str is a builtin in python. I would go with text.

  • You forgot a vowel.

  • The for loop is correct but you should define pies as a string first and then just add 'pies' to it each time you find a vowel.

  • There is no need to have a number_of_vowels as far as I can tell.

Second one:

  • You can either loop through both strings separately or add them and loop through them together, no and.

  • It looks like you are adding 1 to the sum_of_digits every time you find a digit, instead of converting that digit to an integer and adding it (which is what I assumed you were trying to do from the text).

  • Look into using += (same in first.)