擅长:python、mysql、java
<p>您只需执行以下操作:</p>
<pre><code>def smaller_than_n_list(input_list, n):
result = []
for i in input_list: #i will be equal to 1, then, 2 ... to each value of your list
if n > i:
result.append(i) #it will append the value, not the index
return result
</code></pre>