Notification texts go here Contact Us Click here

PYTHON using Convert a string in lower or upper or replace or find or search that's string

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated



name="Tony Stark"
print(name.replace("Stark","IRONMAN"))   #here we replace Stark with IRONMAN.
print(name.upper())                      #here we convert name declared value into uppercase.
print(name.lower())                      #here we convert name declared value into lowercase.
print(name.find('t'))                    #here we find an alphabet or whole string into name.
print('S' in name)                       #here we search an alphabet or letters or whole string.
print('Stark' in name)                   #here we search an alphabet or letters or whole string.
print('m' in name)                       #here we search an alphabet or letters or whole string.


OUTPUT: 
Tony IRONMAN      #here word 'Stark' is replace by 'IRONMAN' by using function 'replcae()'
TONY STARK        #here convert whole string into uppercase or capital letters
tony stark        #here convert whole string into lowercase or small letters.
6                 #it found the elements 't' whose index is '6'.
True           #it found that alphabet
True             #it found that string.
False            #it is not found that alphabet

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.