-
2023.7.8.토요일TIL( Today I Learned) 2023. 7. 10. 13:53
* 1 * 팔린드롬(palindrome) 문제
def is_palindrome(word):
# Remove any whitespace and convert to lowercase for case-insensitive comparison
word = word.replace(" ", "").lower()
# Check if the reversed word is equal to the original word
if word == word[::-1]:
return True
else:
return False
# Example usage:
word = "level"
print(is_palindrome(word)) # Output: True***************************************************************************************************
#***파이썬 데이타 다루기
import numpy as np
# 여기에 코드를 작성하세요
arr = np.arange(3,101,3)
#arr = list(filter(lambda x: x % 3 == 0, range(1, 101)))
# 테스트 코드
arr ='TIL( Today I Learned)' 카테고리의 다른 글
7.11.화요일 (0) 2023.07.12 7.10.월요일 - 데이타 오류 경험 (0) 2023.07.10 2023.7.8. / 최빈값 구하기와 Python의 내장 클래스, Counter (0) 2023.07.07 2023.7.7. 금요일 - map() 함수 & lambda() 함수 (0) 2023.07.07 2023.7.6.목요일 (0) 2023.07.06