Python checkio "Striped Words"解决方案
来源:互联网 发布:免费网页数据采集器 编辑:程序博客网 时间:2024/06/05 14:32
VOWELS = "AEIOUY"CONSONANTS = "BCDFGHJKLMNPQRSTVWXZ"def checkio(text): import string text = ''.join([' ' if char in string.punctuation else char for char in text ]) words = text.split() return sum([checkword(word) if word.isalpha() else 0 for word in words])def checkword(word): if len(word) == 1 :return 0 return 1 if all([True if (word[i].upper() in VOWELS and word[i + 1].upper() in CONSONANTS) or (word[i + 1].upper() in VOWELS and word[i].upper() in CONSONANTS) else False for i in range(len(word)-1)]) else 0
阅读全文
0 0
- Python checkio "Striped Words"解决方案
- checkio -- Striped Words
- CheckIO Striped Words
- Python checkio median解决方案
- Python checkio "Friends"解决方案
- Python checkio Monkey Typing解决方案
- Python checkio Pawn Brotherhood解决方案
- Python checkio Long Repeat解决方案
- Python checkio First Word解决方案
- Python checkio Secret Message解决方案
- Python checkio Index Power解决方案
- Python checkio Digits Multiplication解决方案
- Python checkio Days Between解决方案
- Python checkio Cipher map解决方案
- Python checkio Boolean Algebra解决方案
- Python checkio "Ghosts age"解决方案
- Python checkio "Speech Module"解决方案
- Python checkio "Making Change"解决方案
- Arcgis Engine 裁切影像为Tiff总结2
- mysql主从同步(2)-问题梳理
- 16.忽略大小写的字符串比较
- 【结构体】关于结构体,枚举,联合,位段的一些知识
- [BZOJ3053]The Closest M Points(KD-tree+堆)
- Python checkio "Striped Words"解决方案
- PAT乙级1022. D进制的A+B (20)
- LAMP源码安装之一---PHP安装出错
- 【Shiro】Apache Shiro架构之实际运用(整合到Spring中)
- 数据结构实验之查找二:平衡二叉树
- 100、类加载和反射
- 好久不见
- C++的发展史
- spring-cloud-config-server version 1.5.3.RELEASE 源码初探 1