mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Flake8: Drop ignore of issue A003 (#7949)
* Flake8: Drop ignore of issue A003 * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -40,7 +40,6 @@ class Vector:
|
||||
__sub__(other: Vector): vector subtraction
|
||||
__mul__(other: float): scalar multiplication
|
||||
__mul__(other: Vector): dot product
|
||||
set(components: Collection[float]): changes the vector components
|
||||
copy(): copies this vector and returns it
|
||||
component(i): gets the i-th component (0-indexed)
|
||||
change_component(pos: int, value: float): changes specified component
|
||||
@ -119,17 +118,6 @@ class Vector:
|
||||
else: # error case
|
||||
raise Exception("invalid operand!")
|
||||
|
||||
def set(self, components: Collection[float]) -> None:
|
||||
"""
|
||||
input: new components
|
||||
changes the components of the vector.
|
||||
replaces the components with newer one.
|
||||
"""
|
||||
if len(components) > 0:
|
||||
self.__components = list(components)
|
||||
else:
|
||||
raise Exception("please give any vector")
|
||||
|
||||
def copy(self) -> Vector:
|
||||
"""
|
||||
copies this vector and returns it.
|
||||
|
Reference in New Issue
Block a user