6.01 Lecture Notes - Exponentiation, Be3, Mental Model

4 views11 pages

Document Summary

Now, the remaining lack of clarity is in the handling of the booleans. We can replace if a[itera] == b[iterb]: tempokay = true with tempokay = tempokay or (a[itera] == b[iterb]) which will set tempokay to true if a[itera] == b[iterb], and other- wise leave it the same. And we can replace if tempokay == false: okay = false with okay = okay and tempokay. It still has the e ect that if tempokay is false, then okay will be false, and otherwise it will be as it was before. So, now we have: def issubset(a,b): okay = true for itera in range(len(a)): tempokay = false for iterb in range(len(b)): tempokay = tempokay or a[itera] == b[iterb] okay = okay and tempokay return okay. Object-oriented programming is a popular way of organizing programs, which groups together data with the procedures that operate on them, thus facilitating some kinds of modularity and abstraction.

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