Testing Class Material
This commit is contained in:
commit
05b1f6cdd5
85 changed files with 102796 additions and 0 deletions
65
hands_on/debugger/analyze_sums_and_differences.ipynb
Normal file
65
hands_on/debugger/analyze_sums_and_differences.ipynb
Normal file
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "30f3f04f",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from debugger_example import sum_over_difference"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "3632cacb",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"result = sum_over_difference(7, 5)\n",
|
||||
"print(result)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "02577028",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"result = sum_over_difference(12, 12)\n",
|
||||
"print(result)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "58fc58c0",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
23
hands_on/debugger/debugger_example.py
Executable file
23
hands_on/debugger/debugger_example.py
Executable file
|
@ -0,0 +1,23 @@
|
|||
def add(arg1, arg2):
|
||||
return arg1 + arg2
|
||||
|
||||
|
||||
def sub(arg1, arg2):
|
||||
return arg1 - arg2
|
||||
|
||||
|
||||
def div(arg1, arg2):
|
||||
return arg1 / arg2
|
||||
|
||||
|
||||
def sum_over_difference(arg1, arg2):
|
||||
"""Compute sum of arguments over difference of arguments."""
|
||||
arg_sum = add(arg1, arg2)
|
||||
arg_diff = sub(arg1, arg2)
|
||||
sum_over_diff = div(arg_sum, arg_diff)
|
||||
return sum_over_diff
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
result = sum_over_difference(7, 5)
|
||||
print(result)
|
Loading…
Add table
Add a link
Reference in a new issue