Skip to content
Snippets Groups Projects
Commit 78812b5e authored by Ashwin Maran's avatar Ashwin Maran
Browse files

update p1

parent a6cf33de
No related branches found
No related tags found
No related merge requests found
%% Cell type:raw id:aac30aec tags:
%% Cell type:code id:d7687212 tags:
# ASSIGNMENT CONFIG
solutions_pdf: true
export_cell:
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
import otter
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
from IPython.display import display, Javascript
display(Javascript('IPython.notebook.save_checkpoint();'))
```
%% Output
%% Cell type:code id:f0f8872d tags:
True
%% Cell type:raw id:34e6a864 tags:
``` python
grader.export(pdf=False, run_tests=True)
```
# END TESTS
%% Cell type:markdown id:67c217c2 tags:
%% Cell type:raw id:e42b2d01 tags:
# END QUESTION
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment