Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lect18.md #61

Merged
merged 1 commit into from
Mar 4, 2020
Merged
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
24 changes: 22 additions & 2 deletions _lectures/lect18.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
---
num: Lec 18
num: Lec18
lecture_date: 2020-03-04
desc:
ready: false
ready: true
pdfurl:
---

# Questions
* Question: Why would you just want to store one object in a tuple?
* Ans: If you store stuff in a tuple, the object will not change.

```python
def printPet(aDict, key):
age = aDict[key]['age']
pettype = aDict[key]['type']
date = aDect[key]['date']
format_str = "{} is a {} who is {} old and we got it on {}"
print(format_str.format(key, pettype, age, date))

'''
Output:
printPet(pets,'Cutie')
Cutie is a poddle who is 3 months old and we got it on 03/04/2020
'''
```