You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
mod A function that returns the remainder of two numbers.
pow A function that raises a number to the power of another number.
neg A function that negates a number.
abs A function that returns the absolute value of a number.
Logical operators
not A function that performs a logical NOT operation.
and A function that performs a logical AND operation.
or A function that performs a logical OR operation.
Comparison operators
eq A function that compares two values for equality.
ne A function that compares two values for inequality.
lt A function that compares two values for less-than.
gt A function that compares two values for greater-than.
le A function that compares two values for less-than-or-equal.
ge A function that compares two values for greater-than-or-equal.
Lists operators
all A function that checks if all elements of a list satisfy a predicate.
any A function that checks if any element of a list satisfies a predicate.
concat A function that concatenates two lists.
contains A function that checks if a list contains an element.
drop A function that drops the first n elements of a list.
drop_while A function that drops the first n elements of a list that satisfy a predicate.
filter A function that filters a list based on a predicate.
find A function that finds the first element of a list that satisfies a predicate.
find_index A function that finds the first index of a list that satisfies a predicate.
Notes
All this functions will be implemented after OOP is implemented. Because they will be implemented as magic methods, they will be implemented in the Object class.
Magic methods
The magic methods are the methods that are called when an operator is used on an object. For example, when you use the add operator on two numbers, the __add__ method is called.
The text was updated successfully, but these errors were encountered:
Mathematical operators
add
A function that adds two numbers.sub
A function that subtracts two numbers.mul
A function that multiplies two numbers.div
A function that divides two numbers.mod
A function that returns the remainder of two numbers.pow
A function that raises a number to the power of another number.neg
A function that negates a number.abs
A function that returns the absolute value of a number.Logical operators
not
A function that performs a logical NOT operation.and
A function that performs a logical AND operation.or
A function that performs a logical OR operation.Comparison operators
eq
A function that compares two values for equality.ne
A function that compares two values for inequality.lt
A function that compares two values for less-than.gt
A function that compares two values for greater-than.le
A function that compares two values for less-than-or-equal.ge
A function that compares two values for greater-than-or-equal.Lists operators
all
A function that checks if all elements of a list satisfy a predicate.any
A function that checks if any element of a list satisfies a predicate.concat
A function that concatenates two lists.contains
A function that checks if a list contains an element.drop
A function that drops the first n elements of a list.drop_while
A function that drops the first n elements of a list that satisfy a predicate.filter
A function that filters a list based on a predicate.find
A function that finds the first element of a list that satisfies a predicate.find_index
A function that finds the first index of a list that satisfies a predicate.Notes
All this functions will be implemented after OOP is implemented. Because they will be implemented as magic methods, they will be implemented in the
Object
class.Magic methods
The magic methods are the methods that are called when an operator is used on an object. For example, when you use the
add
operator on two numbers, the__add__
method is called.The text was updated successfully, but these errors were encountered: