fb pixel

Introduction to Python

  • Profound Academy

    • Status
      • 1
        Input and Output
      • 2
        Variables and Integer Arithmetic
      • 3
        Conditional Operators
      • 4
        Advanced Conditions - Nesting
      • 5
        Types and Variables
      • 6
        Strings
      • 7
        Lists
      • 8
        For Loops
      • 9
        While Loops
      • 10
        continue, break, while...else
      • 11
        String and List methods
      • 12
        Nested Loops
      • 13
        List Comprehension
      • 14
        Tuples and Sets
      • 15
        dict
      • 16
        Functions
      • 17
        Functions 2
      • 18
        Lambda and higher-order functions
      • 19
        Files

  • Caps lock

    When typing an essay the writer didn’t notice that the caps lock was on. So, the whole text was written with a complete opposite casing. All the uppercase letters were actually lowercase and the lowercase ones were uppercase.
    Can you help and fix it?
    The program receives several lines, which are the contents of the essay. The final line is the phrase The End! (which also has the wrong casing).
    The program should print as many lines as the input contains and fix all the casing issues.
    Input
    Output
    dEAR AUDIENCE, tHIS ESSAY IS ABOUT aNNA. hOPE YOU'LL ENJOY IT! tHE eND!
    Dear audience, This essay is about Anna. Hope you'll enjoy it! The End!
     
    To check your solution you need to sign in
    Sign in to continue