如标题所示,
<form id="newsletterForm">
<div>
<input type="email" id="newsletterInput" name="email" placeholder="Email Address *"><input type="submit" id="newsletterSubmit">
</div>
<!--// inside of the form //-->
<div id="newsletterValidate"></div>
</form>
multiples_of_3(3,9)
答案 0 :(得分:1)
将print(storage_list)
移出forloop
In [3]: def multiples_of_3(x, y):
...: y = y + 1
...: storage_list = []
...: for i in range(x, y):
...: if i % 3 == 0:
...: storage_list.append(i)
...: print(storage_list)
...:
...:
In [4]: multiples_of_3(3, 9)
[3, 6, 9]
In [5]:
答案 1 :(得分:0)
我以下是你想要的:
def multiples_of_3(x, y):
y = y + 1
storage_list = []
for i in range(x, y):
if i % 3 == 0:
storage_list.append(i)
print(storage_list)
multiples_of_3(3, 9)
你只需要将print语句带到if和for循环之外,这样只有当这两个语句都执行完毕时才打印。