1.

Give an example of swapcase( ) in Python

Answer»

The following example shows the usage of swapcase( ) method. 

# !/usr/bin/py thon

str = “this is string example….wow!!!”;

print str.swapcase( ); 

str = “THIS IS STRING EXAMPLE….WOW!!!”; print str.swapcase( );

This will produce the following result : 

THIS IS STRING EXAMPLE….WOW!!! 

this is string example….wow!!!



Discussion

No Comment Found