Yes, this is how you do this, but in pythonhttps://doc.rust-lang.org/std/iter/trait.Iterator.html#method.count