Suppose I have a line:

stroka = input() 

Input data:

 QWERTYUIOPASdfghjklzxcvbnm 

How to make so that at the exit all the letters change their register (small letters become large, large - small)?

 qwertyuiopasDFGHJKLZXCVBNM 
  • 3
    I think it makes no sense to describe all the standard built-in functions for working with strings in the form of questions and answers. For this there is documentation and many other similar sites - MaxU
  • 2
    @MaxU in the discussion of this issue, which is now deleted by the moderator , was convincingly shown that such questions can and should be created . My goal is to transfer all official python documentation to ruSO. This is only the beginning - andreymal
  • 2
    @andreymal if this is a kind of tutorial, then why not combine into one question, for example, all string methods related to register transformations? Or will it no longer meet the criteria for a good question? - mkkik
  • one
    @MaxU ask the person who deleted the discussion in that question, not me. The community has approved such questions — I make such questions, that's all. - andreymal
  • 2
    @andreymal should not be brought to the point of absurdity. - Nick Volynkin

1 answer 1

Use the swapcase method:

 s = 'QWERTYUIOPASdfghjklzxcvbnm' print(s.swapcase()) 

Result:

 qwertyuiopasDFGHJKLZXCVBNM