mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
Add Nat
class
This commit is contained in:
parent
2b9e214ac6
commit
a565206330
6 changed files with 94 additions and 39 deletions
|
@ -16,6 +16,11 @@ def in_operator(x, y):
|
|||
else:
|
||||
return x in y
|
||||
|
||||
class Nat(int):
|
||||
def times(self, f):
|
||||
for _ in range(self):
|
||||
f()
|
||||
|
||||
class Range:
|
||||
def __init__(self, start, end):
|
||||
self.start = start
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue