forked from CheckiO-Missions/checkio-mission-replace-first
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
def replace_first(items: list) -> list: | ||
from typing import Iterable | ||
|
||
|
||
def replace_first(items: list) -> Iterable: | ||
# your code here | ||
return items | ||
|
||
|
||
if __name__ == '__main__': | ||
print("Example:") | ||
print(replace_first([1, 2, 3, 4])) | ||
print(list(replace_first([1, 2, 3, 4]))) | ||
|
||
# These "asserts" are used for self-checking and not for an auto-testing | ||
assert replace_first([1, 2, 3, 4]) == [2, 3, 4, 1] | ||
assert replace_first([1]) == [1] | ||
assert replace_first([]) == [] | ||
assert list(replace_first([1, 2, 3, 4])) == [2, 3, 4, 1] | ||
assert list(replace_first([1])) == [1] | ||
assert list(replace_first([])) == [] | ||
print("Coding complete? Click 'Check' to earn cool rewards!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters