MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __neg_pos

Method __neg_pos

ciphers/shuffled_shift_cipher.py:47–57  ·  view source on GitHub ↗

Mutates the list by changing the sign of each alternate element :param iterlist: takes a list iterable :return: the mutated list

(self, iterlist: list[int])

Source from the content-addressed store, hash-verified

45 return "".join(self.__passcode)
46
47 def __neg_pos(self, iterlist: list[int]) -> list[int]:
48 """
49 Mutates the list by changing the sign of each alternate element
50
51 :param iterlist: takes a list iterable
52 :return: the mutated list
53
54 """
55 for i in range(1, len(iterlist), 2):
56 iterlist[i] *= -1
57 return iterlist
58
59 def __passcode_creator(self) -> list[str]:
60 """

Callers 1

__make_shift_keyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected