Advertisement
Blessing988

Untitled

Feb 11th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. def up_and_down(word):
  2.     if word==word.upper( ):
  3.         print(word.lower( ))
  4.     elif word==word.lower( ):
  5.         print(word.upper( ))
  6.     else:
  7.         print(word.swapcase( ))
  8.  
  9.  
  10. up_and_down("ThIu is FOr mY bOp") # Example
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement