Skip to content

python 统计元音字母 #9

Description

@lionzhnn

print 'kill game by input end' refdoc=['a','e','i','o','u']; while 1: numbera=0; numbere=0; numberi=0; numbero=0; numberu=0; s=input("input string:"); if s=='end': print 'end game'; break; for i in s: if i in refdoc: if i==refdoc[0]: numbera=numbera+1; elif i==refdoc[1]: numbere=numbere+1; elif i==refdoc[2]: numberi=numberi+1; elif i==refdoc[3]: numbero=numbero+1; else: numberu=numberu+1; print 'the vowel a numbers is '+str(numbera); print 'the vowel e numbers is '+str(numbere); print 'the vowel i numbers is '+str(numberi); print 'the vowel o numbers is '+str(numbero); print 'the vowel u numbers is '+str(numberu);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions