Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
class take_skip: def __init__(self, step, count): self.step = step self.count = count self.iterations = 0 # това е ключово да се създаде def __iter__(self): return self def __next__(self): if self.iterations == self.count: raise StopIteration result = self.iterations * self.step # получава се 0 * 2 = 0, 1 * 2 = 2, 2 * 2 = 4, 3 * 2 = 6, 4 * 2 = 8, 5 * 2 = 10 self.iterations += 1 # итерацията се увеличава с 1 --> 0, 1, 2, 3, 4, 5 return result
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)