Changes between Version 27 and Version 28 of NewbieMistakes


Ignore:
Timestamp:
Sep 27, 2006, 8:11:10 AM (18 years ago)
Author:
Paul Childs
Comment:

Use of p.count() instead of len(p) is recommended in documentation

Legend:

Unmodified
Added
Removed
Modified
  • NewbieMistakes

    v27 v28  
    210210}}}
    211211
    212 The way to do it is test for the length of p:
     212The way to do it is test for p.count:
    213213
    214214{{{
     
    218218>>> p
    219219[]
    220 >>> len(p) == 0
     220>>> p.count() == 0
    221221True
    222222}}}
     
    243243{{{
    244244#!python
    245 >>> p[len(p)-1]
     245>>> p[p.count()-1]
    246246<Poll: What is your favourite colour?>
    247247}}}
Back to Top