COMPSCI 61A Lecture Notes - Lecture 22: Peon, Bourgeoisie, Init

28 views4 pages
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents

Document Summary

Attribute assignment statements can change the first and rest attributes of a link. The rest of a linked list can contain the linked list as a sub-list. Self. elf = worker return bourgeoisie. greeting return self. greeting + , i work". Instance attributes are found before class attributes: class attributes are inherited. Return i gather wealth": does not have instance attribute of greeting, checks in class, evalutes that. Morse code: signaling protocol that transmits messages by sequences of signals implement morse so that decode works correctly tree = [b for b in tree. branches. if b. label == signal][0] for signal in signals: Leaves = [b for b in tree. branches if not b. branches] assert len(leaves) == 1. Attribute assignment assigns to the object immediately to the left of the dot. Abcde = { a": . -", b", -", c": -. -. ", d": -" def decode(signals, tree): def morse(code): Match = [b for b in tree. branches if b. entry == signal] if match:

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions