mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
chore(curriculum): remove strugglers __pyodide and __locals (#54832)
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ Your `merge_sort` function should take a single parameter: `array`.
|
||||
```js
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
str(inspect.signature(__locals.get('merge_sort'))) == '(array)'
|
||||
str(inspect.signature(merge_sort)) == '(array)'
|
||||
`))
|
||||
})
|
||||
```
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ You should add `direction` as the third parameter of your function.
|
||||
```js
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
f = __locals.get("vigenere")
|
||||
f = vigenere
|
||||
sig = str(inspect.signature(f))
|
||||
sig == '(message, key, direction)'
|
||||
`))
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ You should declare a new function called `encrypt`. Remember to use the `pass` k
|
||||
```js
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
f = __locals.get("encrypt")
|
||||
f = encrypt
|
||||
inspect.isfunction(f)
|
||||
`))
|
||||
})
|
||||
@@ -35,7 +35,7 @@ Your `encrypt` function should take `message` and `key` as the parameters. The o
|
||||
```js
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
f = __locals.get("encrypt")
|
||||
f = encrypt
|
||||
sig = inspect.signature(f)
|
||||
str(sig) == "(message, key)"
|
||||
`))
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ You should define a new function called `decrypt`.
|
||||
```js
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
f = __locals.get("decrypt")
|
||||
f = decrypt
|
||||
inspect.isfunction(f)
|
||||
`))
|
||||
})
|
||||
@@ -27,7 +27,7 @@ Your `decrypt` function should take `message` and `key` as the parameters.
|
||||
```js
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
f = __locals.get("decrypt")
|
||||
f = decrypt
|
||||
sig = inspect.signature(f)
|
||||
str(sig) == "(message, key)"
|
||||
`))
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ The `direction` parameter of your `vigenere` function should have a default valu
|
||||
```js
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
f = __locals.get("vigenere")
|
||||
f = vigenere
|
||||
sig = str(inspect.signature(f))
|
||||
sig == '(message, key, direction=1)'
|
||||
`))
|
||||
|
||||
+1
-9
@@ -23,15 +23,7 @@ Test value of `__name__`
|
||||
|
||||
```js
|
||||
({
|
||||
test: () => assert(__pyodide.runPython(`__name__ == '__main__'`))
|
||||
})
|
||||
```
|
||||
|
||||
Test __locals and __pyodide
|
||||
|
||||
```js
|
||||
({
|
||||
test: () => assert(__pyodide.runPython(`__locals.get('add')(4,5) == 9`))
|
||||
test: () => assert(runPython(`__name__ == '__main__'`))
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user