这是我的代码:
import re
line = ("hello moose pole cccttt.ggg cat cow car horse dddfff arizona mississippi cleveland")
pattern = re.compile("[aAeEiIoOuU*]+", re.IGNORECASE)
while line:
for word in pattern.findall(line):
print(word+"\t"+"1")
line = sys.stdin.readline()
输出结果是:
想要实现:
eo 1
ooe 1
oe 1
1
a 1
o 1
a 1
oe 1
1
aioa 1
iiii 1
eea 1
注意:假设对没有元音的单词记为空白。至少我想收集元音。然后,我可以解决非元音单词的问题。
答案 0 :(得分:0)
您可以先构建列表。
$_POST
答案 1 :(得分:0)
您正在寻找:
首先创建一个分割值,冒号
<!DOCTYPE html>
<html lang="en" ng-app="testApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Sample</title>
<style>
.starter-template {
padding: 10px 15px;
text-align: center;
}
a {
font-size: 11px;
cursor: pointer;
}
</style>
</head>
<body>
<div ng-controller="mainCtrl">
<div class="container">
<div class="starter-template">
<h1>Example</h1>
<p class="lead">{{test}}</p>
<my-bootstrap-drop-down
my-label="Some label"
my-options="dropDownOptions"
my-function="runThis" >
</my-bootstrap-drop-down>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="app.js"></script>
</body>
</html>