Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python String swapcase() Method


previous next AddThis Social Bookmark Button


Description:

This method returns a copy of the string in which all the case-based characters have had their case swapped.

Syntax:

str.swapcase();

Parameters:

Here is the detail of parameters:

  • NA

Return Value:

It returns a copy of the string in which all the case-based characters have had their case swapped.

Example:

#!/usr/bin/python

str = "this is string example....wow!!!";
print str.swapcase();

str = "THIS IS STRING EXAMPLE....WOW!!!";
print str.swapcase();

This will produce following result:

this is string example....wow!!!


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names