string = 'ооаРлмГОАЕОораертлНрНППОО' for i in string : if i . is_upper ( ) : string . replace ( i , '' ) print ( string )