chore(curriculum): remove strugglers __pyodide and __locals (#54832)

This commit is contained in:
Ilenia
2024-05-16 14:54:03 +02:00
committed by GitHub
parent 5d0602179f
commit 5f00c88bcb
6 changed files with 8 additions and 16 deletions
@@ -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)'
`))
})
```
@@ -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)'
`))
@@ -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)"
`))
@@ -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)"
`))
@@ -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)'
`))
@@ -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__'`))
})
```