본문 바로가기
프로그래밍 문제/[Python] CheckIO

[CheckIO/Scientific Expedition] Pangram

by Physics 2024. 3. 24.
728x90

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) < 123 and ord(character) > 96:
            List.append(character)
    
    for char in sorted(set(List)):
        pangram +=char   
        
    if pangram == "abcdefghijklmnopqrstuvwxyz":
        return True
    else: return False

 

728x90

댓글