Lexical analyzer that will print the results in Python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gbennett413
    New Member
    • Sep 2015
    • 1

    Lexical analyzer that will print the results in Python

    I need the Python code that can do this. The only problem is that I don't know how to do it
    Inputs a sentence or a paragraph
    Counts the number of vowels, consonants, digits, white space and other characters
    Prints the analysis to the screen
    Example
    Input: Hello

    Output: length: 5, consonants: 3, vowels: 2, digits: 0, white space: 0, 0: other characters: 0
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    The only problem is that I don't know how to do it
    That statement is too vague to act upon, i.e. explain what "it" is. Which parts do you know how to do and which parts do you have code for that is not giving the correct result. Naturally parts like input, counting, etc. are available on any online tutorial so if we assume you know them, then what code remains that you want help with?

    Comment

    Working...