updated with all the changed asked
This commit is contained in:
17
snippets/arithmetic_progression.md
Normal file
17
snippets/arithmetic_progression.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
title: arithmetic_progression
|
||||||
|
tags: math, beginner
|
||||||
|
---
|
||||||
|
|
||||||
|
Find all the multiples between a number and a limit.
|
||||||
|
|
||||||
|
Use the `range` function and step up the same integer to find multiples.
|
||||||
|
|
||||||
|
```py
|
||||||
|
def find_multiples(integer, limit):
|
||||||
|
return list(range(integer,limit+1, integer))
|
||||||
|
```
|
||||||
|
|
||||||
|
```py
|
||||||
|
find_multiples(5,25)
|
||||||
|
```
|
||||||
@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
title: find_multiples
|
|
||||||
tags: list, beginner
|
|
||||||
---
|
|
||||||
|
|
||||||
Find all the multiples between a number and a limit
|
|
||||||
|
|
||||||
Use the range function and step up the same integer to find multiples
|
|
||||||
|
|
||||||
```py
|
|
||||||
def find_multiples(integer, limit):
|
|
||||||
return list(range(integer,limit+1, integer))
|
|
||||||
```
|
|
||||||
|
|
||||||
```py
|
|
||||||
find_multiples(5,25) # returns [5, 10, 15, 20, 25]
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user