Print Friendly and PDF
var1 = 'A software engineer'
var2 = 'is a licensed professional engineer'
var3 = 'who is schooled and skilled in the application of engineering discipline to the creation of software.'
var4 = 'A software engineer is often confused with a programmer,'
var5 = 'but the two are vastly different '
print "software eng :- ", var1[:26] + ' ' +  var2[:56] + ' ' + var3[:96] + ' ' + var4[:60] + ' ' + var5[:56] + 'disciplines.'
str = "a software engineer";
print "str.capitalize() : ", str.capitalize() #its first character capitalized
sub = "a";
print "string.count: ", str.count(sub) #Counts how many times str occurs in string
str1 = "a software engineer";
str2 = "e";
print str1.find(str2) #index beg and ending index end
print str1.find(str2, 10)
print str1.find(str2, 40)
print str.islower()
print str.isupper()
print "Length of the string: ", len(str) #length of the string
print str.lower()
print str.upper()
print "Max character: " + max(str)
print "Min character: " + min(str)
print str.replace("a", "Ahmed mohsin is", 1)
print str.swapcase() #case-based characters have had their case swapped.
print str.title()

zubairsaif

Zubair saif

A passionate writer who loves to write on new technology and programming

Post A Comment:

0 comments: