Created
January 20, 2023 13:55
-
-
Save Ruslan-Skira/44cfdbf31e9ba7bb8c12fd36b44d54c1 to your computer and use it in GitHub Desktop.
Logic tasks from job interview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# parameterize decorator | |
def args_info():pass | |
@args_info(all_values=False) | |
def power(n:int, pwr: int) -> int: | |
"""Put in the power""" | |
return n**pwr | |
# >>> power(2, 4) | |
# ~ Called with 2 args ~ | |
# 16 | |
# >>> power(n=2, pwr=4) | |
# ~ Called with 2 args ~ | |
# 16 | |
@args_info(all_values=True) | |
def power(n: int, pwr: int) -> int: | |
"""Put in the power""" | |
return n ** pwr | |
# >>> power(2, 4) | |
# ~ Called with: 2 4 ~ | |
# 16 | |
# >>> power(n=2, pwr=4) | |
# ~ Called with: 2 4 ~ | |
# 16 | |
""" | |
Write function | |
CONST = "EFFECT | |
function('EEFECT') => 0 | |
function('EfFECT') => 1 | |
function('EFFECT EECT FF ') => 2 | |
witch return how much CONST word you could create from letters | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment