def solution(str1, str2): if str2 in str1: return 1 else: return 2
str1 안에 str2 가 있다면, 1을 return 아니면 2를 return
다른사람 풀이를 보다가 내가 작성한 코드를 한 줄로 작성할 수 있다는 것을 알게 되었다.
def solution(str1, str2): return 1 if str2 in str1 else 2