小编oez*_*lem的帖子

在一个单词中找到连续的辅音

我需要能够向我显示一个单词中连续辅音的代码.例如,因为"concertation"我需要获得["c","nc","rt","t","n"].

这是我的代码:

def SuiteConsonnes(mot):
    consonnes=[]
    for x in mot:
        if x in "bcdfghjklmnprstvyz":
           consonnes += x + ''
    return consonnes
Run Code Online (Sandbox Code Playgroud)

我设法找到辅音,但我不知道如何连续找到它们.谁能告诉我我需要做什么?

python string

13
推荐指数
3
解决办法
4130
查看次数

标签 统计

python ×1

string ×1