I&C SCI 32 Lecture 4: Week 4 Word Notes (2015)
55 views1 pages
23 Jun 2018
School
Department
Course
Professor
Hit Counter
Restrictions
-Count: Make it hard to do anything but increase by one
-Initialize (which sets it to zero)
-“peek” (find out what it is without changing it)
-“reset” (set it back to zero again)
>>> c1= Counter() #c1’s count should be 0
>>>c1.count()
1
>>>c1.count()
2
>>>c1.peek()
2
>>>c1.count()
3
>>>c1.reset()
0
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document
This preview shows half of the first page of the document.
Unlock all 1 pages and 3 million more documents.
Already have an account? Log in
Get access
Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers