Skip to content
Open
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
92 changes: 72 additions & 20 deletions your-code/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -32,7 +32,7 @@
" \"\"\"\n",
" \n",
" # your code here\n",
" "
" return [lmbda(x) for x in lst]\n"
]
},
{
Expand All @@ -46,11 +46,12 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"# your code here"
"# your code here\n",
"celsius_conv = lambda c: c + 273.15"
]
},
{
Expand All @@ -62,13 +63,25 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 14,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"[285.15, 296.15, 311.15, 218.14999999999998, 297.15]"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"temps = [12, 23, 38, -55, 24]\n",
"\n",
"# your code here"
"# your code here\n",
"modify_list(temps, celsius_conv)"
]
},
{
Expand All @@ -86,7 +99,8 @@
"metadata": {},
"outputs": [],
"source": [
"# your code here"
"# your code here\n",
"mod=lambda x,y: 1 if x % y == 0 else 0"
]
},
{
Expand All @@ -100,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -111,7 +125,8 @@
" divisible by another number (to be passed later) and zero otherwise.\n",
" \"\"\"\n",
" \n",
" # your code here"
" # your code here\n",
" return lambda x: 1 if x % b == 0 else 0"
]
},
{
Expand All @@ -123,11 +138,12 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"# your code here"
"# your code here\n",
"divisible5 = divisor(5)"
]
},
{
Expand All @@ -139,18 +155,41 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"1"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"divisible5 = divisor(5)\n",
"divisible5(10)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"0"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"divisible5(8)"
]
Expand Down Expand Up @@ -199,14 +238,27 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 23,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"['Green eggs', 'cheese', 'English cucumber', 'tomato']"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list1 = ['Green', 'cheese', 'English', 'tomato']\n",
"list2 = ['eggs', 'cheese', 'cucumber', 'tomato']\n",
"\n",
"# your code here"
"# your code here\n",
"comb_strings_spaces = lambda a, b: a + ' ' + b if a != b else a\n",
"[comb_strings_spaces(a, b) for (a, b) in zip(list1, list2)]"
]
},
{
Expand Down Expand Up @@ -269,7 +321,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.8.3"
}
},
"nbformat": 4,
Expand Down