Add typehints ciphers and bool alg (#3264)

* updating DIRECTORY.md

* updating DIRECTORY.md

* Fixed accidental commit of file I have't touched

* fixup! Format Python code with psf/black push

* updating DIRECTORY.md

* updating DIRECTORY.md

* Fixed some suggested coding style issues

* Update rsa_key_generator.py

* Update rsa_key_generator.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
This commit is contained in:
Jenia Dysin
2020-10-16 09:11:52 +03:00
committed by GitHub
parent 5b024f4dd5
commit 9d745b6156
25 changed files with 92 additions and 73 deletions

View File

@ -1,4 +1,4 @@
def compare_string(string1, string2):
def compare_string(string1: str, string2: str) -> str:
"""
>>> compare_string('0010','0110')
'0_10'
@ -19,7 +19,7 @@ def compare_string(string1, string2):
return "".join(l1)
def check(binary):
def check(binary: [str]) -> [str]:
"""
>>> check(['0.00.01.5'])
['0.00.01.5']
@ -43,7 +43,7 @@ def check(binary):
binary = list(set(temp))
def decimal_to_binary(no_of_variable, minterms):
def decimal_to_binary(no_of_variable: int, minterms: [float]) -> [str]:
"""
>>> decimal_to_binary(3,[1.5])
['0.00.01.5']
@ -59,7 +59,7 @@ def decimal_to_binary(no_of_variable, minterms):
return temp
def is_for_table(string1, string2, count):
def is_for_table(string1: str, string2: str, count: int) -> bool:
"""
>>> is_for_table('__1','011',2)
True
@ -79,7 +79,7 @@ def is_for_table(string1, string2, count):
return False
def selection(chart, prime_implicants):
def selection(chart: [[int]], prime_implicants: [str]) -> [str]:
"""
>>> selection([[1]],['0.00.01.5'])
['0.00.01.5']
@ -126,7 +126,7 @@ def selection(chart, prime_implicants):
chart[j][i] = 0
def prime_implicant_chart(prime_implicants, binary):
def prime_implicant_chart(prime_implicants: [str], binary: [str]) -> [[int]]:
"""
>>> prime_implicant_chart(['0.00.01.5'],['0.00.01.5'])
[[1]]