09-20-周六_14-54-32

This commit is contained in:
2025-09-20 14:54:32 +08:00
parent 836df0d56c
commit 7b53b37b3b

View File

@@ -14,7 +14,7 @@ variable = [out_exp_res for out_exp in input_list if out_exp == 2]
30以内所有能被3整除的数
```python
multiples = [i for i in range(30) if i % 3 is 0]
multiples = [i for i in range(30) if i % 3 == 0]
print(multiples)
```
@@ -23,7 +23,7 @@ print(multiples)
```python
def squared(x):
return x*x
multiples = [squared(i) for i in range(30) if i % 3 is 0]
multiples = [squared(i) for i in range(30) if i % 3 == 0]
print(multiples)
```