Skip to content

Commit 25b0c79

Browse files
committed
loop
1 parent 47e6a3a commit 25b0c79

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

exam1/loopty_loop.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def generate_list(start: int, stop: int, step: int = 1) -> List[int]:
1010
:param step: How many digits apart each number is from the others around it.
1111
:return: A list of integers.
1212
"""
13+
return list(range(start,stop,step))
1314
pass # implement me
1415

1516

@@ -23,4 +24,9 @@ def generate_list_with_strategy(start: int, stop: int, step: int, strategy: Call
2324
:param strategy: A function to manipulate each digit .
2425
:return: A list of integers.
2526
"""
27+
listre = list(range(start,stop,step))
28+
result =[]
29+
for num in listre:
30+
result.append(strategy(num))
31+
return result
2632
pass # implement me

0 commit comments

Comments
 (0)