Extract Uppercase Letters from String

  • Share this:

Code introduction


This function takes an input string and returns a list containing all uppercase letters from the input string.


Technology Stack : List comprehension

Code Type : List generator

Code Difficulty : Intermediate


                
                    
def a_to_z_list(input_string):
    return [char for char in input_string if char.isalpha() and char.isupper()]