Skip to content
Open

rv #88

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 94 additions & 11 deletions your-code/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def modify_list(lst, lmbda=lambda x : for x in lst):\n",
" print(x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -50,7 +60,7 @@
"metadata": {},
"outputs": [],
"source": [
"# your code here"
"convert = lambda x : x + 273.15"
]
},
{
Expand All @@ -62,7 +72,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -71,6 +81,24 @@
"# your code here"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[285.15, 296.15, 311.15, 218.14999999999998, 297.15]\n"
]
}
],
"source": [
"kelvin = list(map(lambda x: x + 273.15,temps))\n",
"print(kelvin)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -82,11 +110,31 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"# your code here"
"mod = lambda x,y : 1 if x % y == 0 else 0"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mod(7,5)"
]
},
{
Expand Down Expand Up @@ -114,6 +162,17 @@
" # your code here"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"def divisor(b):\n",
" mod = lambda b,y : 1 if b % y == 0 else 0\n",
" return mod"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -123,11 +182,11 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"# your code here"
"divisible5=divisor(5)"
]
},
{
Expand All @@ -139,18 +198,42 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "TypeError",
"evalue": "<lambda>() missing 1 required positional argument: 'b'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-21-f415c02b249c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mdivisible5\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: <lambda>() missing 1 required positional argument: 'b'"
]
}
],
"source": [
"divisible5(10)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "TypeError",
"evalue": "<lambda>() missing 1 required positional argument: 'b'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-22-469dc508f972>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mdivisible5\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m8\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: <lambda>() missing 1 required positional argument: 'b'"
]
}
],
"source": [
"divisible5(8)"
]
Expand Down Expand Up @@ -269,7 +352,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.8.6"
}
},
"nbformat": 4,
Expand Down