473,480 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Lexical analyzer that will print the results in Python

1 New Member
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
1 1431
dwblas
626 Recognized Expert Contributor
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

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

Similar topics

5
3440
by: Humpdydum | last post by:
Any freeware/open-source that does that? Windows- OR Linux-based is fine. On Linux it would be s/t like "pyprint -r *.py > out.ps" where -r indicates recursive. Done a search on google and nothing...
0
1093
by: liezel | last post by:
I want to make a program in c which produce an output that will allow the user to create or input a program or even a simple code of FOR LOOP and will will produce the output of it in the same...
2
9826
by: mekah | last post by:
Hi, My name is meka. I need an example on how to create an lexical analyzer without using a tokenizer. This project is due April 8,08. Thanks if anyone can help.
0
810
by: python | last post by:
I understand that many portions of the string module are redundant with the native methods of strings and will removed in Python 3.0. Makes sense to me. But what will happen to the portions of...
0
834
by: Christian Heimes | last post by:
python@bdurham.com schrieb: See for yourself: http://svn.python.org/projects/python/branches/py3k/Lib/string.py Christian
4
3241
by: bhappy | last post by:
Hi All, How to check the arithmetic expression is valid or not like lexical analyzer in vb.net? ex: (A+B)=C --Syntax Correct. Thanks, Aswath.
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7048
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4783
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2997
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2986
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
183
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.