" instructions: \"SUBMISSION INSTRUCTIONS: The zipfile automatically gets downloaded. You should have received GradeScope invite - please accept it. Login to GradeScope and upload the zipfile. Check otter results as soon as auto-grader gets completed.\"\n",
" pdf: false\n",
"generate: true"
"# import and initialize otter\n",
"import otter\n",
"grader = otter.Notebook(\"p1.ipynb\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4874d9e2",
"metadata": {},
"id": "5a9e68fd",
"metadata": {
"deletable": false
},
"outputs": [],
"source": [
"# PLEASE FILL IN THE DETAILS\n",
"# Enter None if you don't have a project partner\n",
"# Enter none if you don't have a project partner\n",
"\n",
"# project: p1\n",
"# submitter: NETID1\n",
"# partner: NETID2\n",
"# partner: none\n",
"# hours: ????"
]
},
{
"cell_type": "raw",
"id": "97ac2d11",
"metadata": {},
"source": [
"# BEGIN QUESTION\n",
"name: q1\n",
"points: 12.5"
]
},
{
"cell_type": "markdown",
"id": "2fc08f81",
"metadata": {},
"id": "1f7148e8",
"metadata": {
"deletable": false,
"editable": false
},
"source": [
"**Question 1:** \"Hello, World!\" program."
]
},
{
"cell_type": "raw",
"id": "6add9af9",
"metadata": {},
"source": [
"# BEGIN SOLUTION"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "4751a35d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Hello, World!'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"id": "2506ec80",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"name = \"World\"\n",
"greeting = \"Hello, \" + name + \"!\"\n",
"\n",
"greeting"
]
},
{
"cell_type": "raw",
"id": "5eba2a1d",
"metadata": {},
"source": [
"# END SOLUTION"
]
},
{
"cell_type": "raw",
"id": "a20f4709",
"metadata": {},
"source": [
"# BEGIN TESTS"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "583a6998",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"greeting == \"Hello, World!\""
]
},
{
"cell_type": "raw",
"id": "e070cc78",
"metadata": {},
"source": [
"# END TESTS"
]
},
{
"cell_type": "raw",
"id": "b12d2b8c",
"metadata": {},
"source": [
"# END QUESTION"
]
},
{
"cell_type": "raw",
"id": "3d166bde",
"metadata": {},
"execution_count": null,
"id": "49586bd4",
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"# BEGIN QUESTION\n",
"name: q2\n",
"points: 12.5"
"grader.check(\"q1\")"
]
},
{
"cell_type": "markdown",
"id": "e6847d06",
"metadata": {},
"id": "462bcd1f",
"metadata": {
"deletable": false,
"editable": false
},
"source": [
"**Question 2:** Compute current year."
]
},
{
"cell_type": "raw",
"id": "d6438b98",
"metadata": {},
"source": [
"# BEGIN SOLUTION"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "5c9d59fe",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2022"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"id": "fdbb5e85",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"curr_year = 45 * 45 - 3\n",
"curr_year = 45 * 45 - 2\n",
"\n",
"curr_year"
]
},
{
"cell_type": "raw",
"id": "8b76d9b8",
"metadata": {},
"cell_type": "code",
"execution_count": null,
"id": "f431b8b4",
"metadata": {
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"# END SOLUTION"
"grader.check(\"q2\")"
]
},
{
"cell_type": "raw",
"id": "f5bd1815",
"metadata": {},
"cell_type": "markdown",
"id": "f1397ae4",
"metadata": {
"deletable": false,
"editable": false
},
"source": [
"# BEGIN TESTS"
"## Submission\n",
"Now, click on `Kernel` -> `Restart & Run All` to run all the cells in the notebook.\n",
"The cells below will automatically save your notebook after the previous cells are run, and generate a zip file for you to submit.\n",
"\n",
"**SUBMISSION INSTRUCTIONS**:\n",
"The zipfile automatically gets downloaded. You should have received a GradeScope invite - please accept it.\n",
"Login to GradeScope and upload the zipfile. Check otter results as soon as auto-grader gets completed."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "7fe0d9eb",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"id": "49cef762",
"metadata": {
"cell_type": "code",
"deletable": false,
"editable": false
},
"outputs": [],
"source": [
"curr_year == 2022"
"# running this cell will create a new save checkpoint for your notebook\n",
instructions: "SUBMISSION INSTRUCTIONS: The zipfile automatically gets downloaded. You should have received GradeScope invite - please accept it. Login to GradeScope and upload the zipfile. Check otter results as soon as auto-grader gets completed."
pdf: false
generate: true
``` python
# import and initialize otter
importotter
grader=otter.Notebook("p1.ipynb")
```
%% Cell type:code id:4874d9e2 tags:
%% Cell type:code id:5a9e68fd tags:
``` python
# PLEASE FILL IN THE DETAILS
# Enter None if you don't have a project partner
# Enter none if you don't have a project partner
# project: p1
# submitter: NETID1
# partner: NETID2
# partner: none
# hours: ????
```
%% Cell type:raw id:97ac2d11 tags:
# BEGIN QUESTION
name: q1
points: 12.5
%% Cell type:markdown id:2fc08f81 tags:
%% Cell type:markdown id:1f7148e8 tags:
**Question 1:** "Hello, World!" program.
%% Cell type:raw id:6add9af9 tags:
# BEGIN SOLUTION
%% Cell type:code id:4751a35d tags:
%% Cell type:code id:2506ec80 tags:
``` python
name="World"
greeting="Hello, "+name+"!"
greeting
```
%% Output
'Hello, World!'
%% Cell type:raw id:5eba2a1d tags:
# END SOLUTION
%% Cell type:raw id:a20f4709 tags:
# BEGIN TESTS
%% Cell type:code id:583a6998 tags:
%% Cell type:code id:49586bd4 tags:
``` python
greeting=="Hello, World!"
grader.check("q1")
```
%% Output
True
%% Cell type:raw id:e070cc78 tags:
# END TESTS
%% Cell type:raw id:b12d2b8c tags:
# END QUESTION
%% Cell type:raw id:3d166bde tags:
# BEGIN QUESTION
name: q2
points: 12.5
%% Cell type:markdown id:e6847d06 tags:
%% Cell type:markdown id:462bcd1f tags:
**Question 2:** Compute current year.
%% Cell type:raw id:d6438b98 tags:
# BEGIN SOLUTION
%% Cell type:code id:5c9d59fe tags:
%% Cell type:code id:fdbb5e85 tags:
``` python
curr_year=45*45-3
curr_year=45*45-2
curr_year
```
%% Output
2022
%% Cell type:code id:f431b8b4 tags:
%% Cell type:raw id:8b76d9b8 tags:
``` python
grader.check("q2")
```
# END SOLUTION
%% Cell type:markdown id:f1397ae4 tags:
%% Cell type:raw id:f5bd1815 tags:
## Submission
Now, click on `Kernel` -> `Restart & Run All` to run all the cells in the notebook.
The cells below will automatically save your notebook after the previous cells are run, and generate a zip file for you to submit.
# BEGIN TESTS
**SUBMISSION INSTRUCTIONS**:
The zipfile automatically gets downloaded. You should have received a GradeScope invite - please accept it.
Login to GradeScope and upload the zipfile. Check otter results as soon as auto-grader gets completed.
%% Cell type:code id:7fe0d9eb tags:
%% Cell type:code id:49cef762 tags:
``` python
curr_year==2022
# running this cell will create a new save checkpoint for your notebook