I'm preparing for an exam that's coming up soon about python and seem to have gotten stuck with a task.
The task says as follows:
Data is received as a stream of characters:
- each stream of characters is a sequence of surnames
- the start and end of a sequence is indicated by two * characters (**)
- the surnames are separated by a # character
A typical character sequence is:
**ali#thomas#ghandi#akmar#smith#barija**
Write program code to:
-
input a character sequence (made up of one or more surnames
-
check that the character sequence has a valid format
-
calculate and output the number of surnames*
If anybody out there would be kind enough to help me out, even if it's just a little bit, I would be very grateful.
Thank you all very much for your time.
Cheers, Ben
Aucun commentaire:
Enregistrer un commentaire