CBC
ABC 402Problem 14 of 50
EasyWhat to do
Given a string containing both uppercase and lowercase letters, extract only the uppercase letters and return them as a new string in their original order. For example, 'AtCoderBeginnerContest' → 'ACBC'.
Key Concepts
strings
loops
conditionals (if-statements)
output
Examples
Input:
s = 'AtCoderBeginnerContest'
Output:
ACBC
Input:
s = 'PaymentRequired'
Output:
PR
Tips for Beginners
- Focus on understanding the logic, not memorizing syntax
- Use print statements to debug your code
- Don't worry about input parsing - the function handles that for you
- If stuck, try writing out your solution on paper first
Python Editor
Loading Python...