본문 바로가기
728x90

프로그래밍 문제/[Python] CheckIO50

[CheckIO/Electronic Station] Acceptable Password V 1. Problem: https://py.checkio.org/en/mission/acceptable-password-v/ 2. My solution def is_acceptable_password(password: str) -> bool: # your code here if len(password) 9: return True else: list_boolen = [ x.isnumeric() for x in list(password)] if True in list_boolen : if False in list_boolen: return True re.. 2024. 4. 7.
[CheckIO/Electronic Station] Acceptable Password IV 1. Problem: https://py.checkio.org/en/mission/acceptable-password-iv/ 2. My solution def is_acceptable_password(password: str) -> bool: # your code here if len(password) 9: return True else: list_boolen = [ x.isnumeric() for x in list(password)] if True in list_boolen : if False in list_boolen: return True return False 2024. 4. 7.
[CheckIO/Electronic Station] acceptable-password-ii 1. Problem: https://py.checkio.org/en/mission/acceptable-password-ii/ 2. My solution def is_acceptable_password(password: str) -> bool: # your code here if len(password) < 6: return False else: if True in [ x.isnumeric() for x in list(password)]: return True else: return False 2024. 4. 7.
[CheckIO/Electronic Station] digits-multiplication 1. Problem: https://py.checkio.org/en/mission/digits-multiplication/ 2. My solution: def checkio(number: int) -> int: # your code here dummy = 1; for number in list(str(number)): if int(number) != 0: dummy *=int(number) return dummy 2024. 4. 7.
[CheckIO/Scientific-Expedition] Secret Message 1. Problem: https://py.checkio.org/en/mission/secret-message/ 2. My solution def find_message(message: str) -> str: # your code here dummy = ''; for char in list(message): if char.isupper(): dummy+=char return dummy 2024. 4. 7.
[CheckIO/Scientific Expedition] striped words 1. Problem: https://py.checkio.org/en/mission/striped-words/ 2. My solution import re def checkio(line: str) -> int: text = re.sub(r'[^\w\s]', " ", line) vowel_list = ["a", "e", "i", "o", "u", "y"] consonant_list = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z"] number_striped_words = 0 for dummy_text in text.split(" "): if dummy_text.isnumeri.. 2024. 3. 24.
[CheckIO/Scientific Expedition] Beat The Previous 1. Problem: https://py.checkio.org/en/mission/beat-the-previous/ 2. My solution def beat_previous(digits: str) -> list[int]: # your code here dummy_list = [] list_digits = list(digits) dummy_number = "0" for index in range(len(list_digits)): if index == 0: dummy_list.append(int(list_digits[index])) else: dummy_number+=list_digits[index] if int(dummy_number) 2024. 3. 24.
[CheckIO/Scientific Expedition] Pangram 1. Problem: https://py.checkio.org/en/mission/pangram/ 2. My solution def check_pangram(text): ''' is the given text is a pangram. ''' # your code here List = [] pangram = "" for character in list(text.lower()): if ord(character) 96: List.append(character) for char in sorted(set(List)): pangram +=char if pangram == "abcdefghijklmnopqrstuvwxyz": return True else: return.. 2024. 3. 24.
[CheckIO][Scientific Expedition] Latest-iso-datetime 1. Problem: https://py.checkio.org/en/mission/latest-iso-datetime/ 2. My solution import datetime def get_latest(dt1str: str, dt2str: str) -> str: time_comparison = [] # your code here for date in [dt1str, dt2str]: dummy_data = date.split('-') dummy_data[0] = str(int(date.split('-')[0])+3000) convert_to_unix_time = datetime.datetime.strptime("-".join(dummy_data), "%Y-%m-%dT%H:%M:%S").timestamp().. 2024. 2. 18.
728x90