please kill me
This commit is contained in:
parent
269b932a3b
commit
712c903849
10 changed files with 260 additions and 1 deletions
25
test/lexer/19.in
Normal file
25
test/lexer/19.in
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
def process(items):
|
||||
result = []
|
||||
for i, item in enumerate(items):
|
||||
if item > 0:
|
||||
result.append(item * 2)
|
||||
elif item < 0:
|
||||
result.append(-item)
|
||||
else:
|
||||
pass
|
||||
total = sum(result)
|
||||
return total
|
||||
|
||||
class Calculator:
|
||||
def __init__(self, base=10):
|
||||
self.base = base
|
||||
|
||||
def add(self, x, y):
|
||||
return x + y
|
||||
|
||||
def multiply(self, x, y):
|
||||
return x * y
|
||||
|
||||
x = process([1, -2, 0])
|
||||
calc = Calculator()
|
||||
sum_result = calc.add(5, 15)
|
||||
Loading…
Add table
Add a link
Reference in a new issue