By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,463 Members | 774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,463 IT Pros & Developers. It's quick & easy.

Lexical analyzer that will print the results in Python

P: 1
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
Sep 27 '15 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 619
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?
Sep 28 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.