Compare commits
No commits in common. "a833c0d75c8ff7fa53601f7613b3f0d2f9bc5cac" and "16bbedff48f82c78577382eabf988e92f13e6a69" have entirely different histories.
a833c0d75c
...
16bbedff48
@ -1,18 +0,0 @@
|
|||||||
repos:
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
||||||
rev: v4.5.0
|
|
||||||
hooks:
|
|
||||||
- id: trailing-whitespace
|
|
||||||
- id: end-of-file-fixer
|
|
||||||
- id: check-yaml
|
|
||||||
- id: check-added-large-files
|
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
||||||
rev: v0.3.0
|
|
||||||
hooks:
|
|
||||||
- id: ruff # Linting
|
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
|
||||||
rev: stable
|
|
||||||
hooks:
|
|
||||||
- id: black # formatting
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
"""
|
|
||||||
Lösung des Katas: Caesar Cipher Helper
|
|
||||||
Link: https://www.codewars.com/kata/526d42b6526963598d0004db
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
beginning_alphabet = ord("A")
|
|
||||||
ending_alphabet = ord("Z")
|
|
||||||
|
|
||||||
class CaesarCipher(object):
|
|
||||||
def __init__(self, offset):
|
|
||||||
self.offset = offset
|
|
||||||
|
|
||||||
def encode(self, st):
|
|
||||||
upper = st.upper()
|
|
||||||
encoded_st = ""
|
|
||||||
for char in upper:
|
|
||||||
if beginning_alphabet <= ord(char) <= ending_alphabet:
|
|
||||||
encoded_char = (ord(char) + self.offset)
|
|
||||||
if encoded_char > ending_alphabet:
|
|
||||||
encoded_char -= (ending_alphabet - (beginning_alphabet - 1))
|
|
||||||
encoded_st += chr(encoded_char)
|
|
||||||
else:
|
|
||||||
encoded_st += char
|
|
||||||
|
|
||||||
return encoded_st
|
|
||||||
|
|
||||||
def decode(self, st):
|
|
||||||
decoded_st = ""
|
|
||||||
for char in st:
|
|
||||||
if beginning_alphabet <= ord(char) <= ending_alphabet:
|
|
||||||
decoded_char = (ord(char) - self.offset)
|
|
||||||
if decoded_char < beginning_alphabet:
|
|
||||||
decoded_char += (ending_alphabet - (beginning_alphabet - 1))
|
|
||||||
decoded_st += chr(decoded_char)
|
|
||||||
else:
|
|
||||||
decoded_st += char
|
|
||||||
|
|
||||||
return decoded_st
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
"""
|
|
||||||
Lösung des Katas: Mean Square Error von kylehill
|
|
||||||
Link zum Kata: https://www.codewars.com/kata/51edd51599a189fe7f000015
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
def solution(array_a, array_b):
|
|
||||||
numbers_list = list(zip(array_a, array_b))
|
|
||||||
differences = [x[0] - x[1] for x in numbers_list]
|
|
||||||
mean_square_error = sum([x * x for x in differences]) / len(differences)
|
|
||||||
|
|
||||||
return mean_square_error
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
def addition(a=1, b=2):
|
|
||||||
return a + b
|
|
||||||
|
|
||||||
|
|
||||||
def f(x: int, y: int) -> int:
|
|
||||||
return x + y
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
print(addition(5, 5))
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
from src.moduleA import addition
|
|
||||||
|
|
||||||
|
|
||||||
def test_a():
|
|
||||||
assert addition() == 3
|
|
||||||
assert addition(5, 5) == 10
|
|
||||||
Loading…
x
Reference in New Issue
Block a user