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
10 changed files
with
98 additions
and
59 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 +1 @@ | ||
checkio --domain py autofillrepo --py-function sum_two --js-function sumTwo . | ||
checkio --domain py autofillrepo --py-function replace_first --js-function replaceFirst . |
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
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,19 +1,21 @@ | ||
"use strict"; | ||
|
||
function sumTwo(a, b) { | ||
// sums two passed arguments | ||
|
||
function replaceFirst(a) { | ||
// your code here | ||
return 0; | ||
return undefined; | ||
} | ||
|
||
var assert = require('assert'); | ||
|
||
if (!global.is_checking) { | ||
console.log('Example:'); | ||
console.log(sumTwo(3, 2)); | ||
console.log(replaceFirst([1, 2, 3, 4])); | ||
|
||
// These "asserts" are used for self-checking | ||
assert.deepEqual(replaceFirst([1, 2, 3, 4]), [2, 3, 4, 1]); | ||
assert.deepEqual(replaceFirst([1]), [1]); | ||
assert.deepEqual(replaceFirst([]), []); | ||
|
||
// These "asserts" are used for self-checking and not for an auto-testing | ||
assert.equal(sumTwo(3, 2), 5); | ||
assert.equal(sumTwo(5, 7), 12); | ||
console.log("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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
def sum_two(a, b): | ||
""" | ||
sums two passed arguments | ||
""" | ||
def replace_first(a): | ||
# your code here | ||
return None | ||
|
||
|
||
if __name__ == '__main__': | ||
print("Example:") | ||
print(sum_two(3, 2)) | ||
print(replace_first([1, 2, 3, 4])) | ||
|
||
# These "asserts" are used for self-checking and not for an auto-testing | ||
assert sum_two(3, 2) == 5, "First" | ||
assert sum_two(5, 7) == 12, "Second" | ||
assert replace_first([1, 2, 3, 4]) == [2, 3, 4, 1] | ||
assert replace_first([1]) == [1] | ||
assert replace_first([]) == [] | ||
print("Coding complete? Click 'Check' to earn cool rewards!") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 +1 @@ | ||
Add short description | ||
The first element should become the last one |
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
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