
[x*x for x in range(10)] # 0에서 9까지 숫자의 제곱 값
# [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
st = 'Hello World'
[x.upper() for x in st] # 문자열 각각에 대해 upper() 메서드 적용
# ['H', 'E', 'L', 'L', 'O', ' ', 'W', 'O', 'R', 'L', 'D']
a = ['welcome', 'to', 'the', 'python', 'world']
first_a = [s[0].upper() for s in a]
first_a
# ['W', 'T', 'T', 'P', 'W']
s = ['Hello', '12345', 'World', '67890']
numbers = [x for x in s if x.isdigit()] # 숫자로만 이루어진 문자열을 필터링
print(numbers)
# ['12345', '67890']