반응형
츄르사려고 코딩하는 코집사입니다.
1. [구름LEVEL] 구름 앵무새 꼬꼬 파이썬(Python)
1) 문제 출처
https://level.goorm.io/exam/49053/%EC%95%B5%EB%AC%B4%EC%83%88-%EA%BC%AC%EA%BC%AC/quiz/1
2. 풀이
- 모음이 나오면 res에 추가로 넣는다.
- 대소문자도 구분하니 대소문자 조건도 건다.
- res가 ''이라면, ???를 출력하고 아니라면 res를 출력한다.
4. 소스 코드
T = int(input())
for _ in range(T) :
temp = input()
res = ''
for i in range(len(temp)):
if temp[i] == 'a' or temp[i] == 'A' or temp[i] == 'e' or temp[i] == 'E' or temp[i] == 'i' or temp[i] == 'I' or \
temp[i] == 'o' or temp[i] == 'O' or temp[i] == 'u' or temp[i] == 'U':
res += temp[i]
if res == '' :
print("???")
else :
print(res)
반응형
'알고리즘 > 구름LEVEL' 카테고리의 다른 글
[구름LEVEL] 구름 비트연산 기본 1 파이썬(Python) (0) | 2022.01.28 |
---|---|
[구름LEVEL] 구름 Min 함수 파이썬(Python) (0) | 2022.01.27 |
[구름LEVEL] 구름 네 수의 곱 파이썬(Python) (0) | 2022.01.26 |
[구름LEVEL] 구름 3과 5의 배수 파이썬(Python) (0) | 2022.01.25 |
[구름LEVEL] 구름 Substring 파이썬(Python) (0) | 2022.01.24 |
[구름LEVEL] 구름 3의 배수 게임 파이썬(Python) (0) | 2022.01.23 |
[구름LEVEL] 구름 몫과 나머지 파이썬(Python) (0) | 2022.01.22 |
[구름LEVEL] 구름 Bubble Sort 파이썬(Python) (0) | 2022.01.21 |
최근댓글