In [1]: # captialize() - to make 1st letter from lowercase into uppercase
a="hey buddies"
print([Link]())
Hey buddies
In [2]: # captialize() - make no change in case of integer
age="40 is my age"
print([Link]())
40 is my age
In [10]: #count() - it will count how many times the specified words/letters accurs in the v
b= "welcome to Gurukula"
print([Link]("welcome"))
print([Link]("e"))
print([Link]("u"))
print([Link]("u",0,15))
print([Link]("u",0,17))
1
2
3
2
3
In [12]: #islower() - checks the strings are in lowercase and print true or false and lowe
c="pYthon for Toddlers"
d="pytHon for TODDdlers"
e="python for toddlers"
print([Link]())
print([Link]())
print([Link]())
False
False
True
In [13]: #islower() - checks the all strings are in lowercase and print true or false and
c="pYthon for Toddlers"
d="pytHon for TODDdlers"
e="python for toddlers"
print([Link]())
print([Link]())
print([Link]())
python for toddlers
python for todddlers
python for toddlers
In [14]: #isupper() - checks the all strings are in uppercase and print true or false and
c="pYthon for Toddlers"
d="pytHon for TODDdlers"
e="PYTHON FOR TODDLERS"
print([Link]())
print([Link]())
print([Link]())
False
False
True
In [15]: #isupper() - checks the all strings are in uppercase and print true or false and
c="pYthon for Toddlers"
d="pytHon for TODDdlers"
e="PYTHON FOR TODDLERS"
print([Link]())
print([Link]())
print([Link]())
PYTHON FOR TODDLERS
PYTHON FOR TODDDLERS
PYTHON FOR TODDLERS
In [17]: #SWAPCASE() -it converts upper into lowercase and viceversa
f="PYTHON for TOOddlers"
print([Link]())
python FOR tooDDLERS
In [19]: #istittle()- checks whether first letter of every words are captitalized or not and
g="welcome to gurukula"
print([Link]())
print([Link]())
False
Welcome To Gurukula
In [27]: #startswith()- cheks whether the mentioned string is the starting strings or not
var="hey how are you??"
print([Link]("hey"))
print([Link]("how"))
print([Link]("h"))
print([Link]("he"))
True
False
True
True
In [29]: #endswith()- cheks whether the mentioned string is the ending strings or not
var="hey how are you??"
print([Link]("you"))
print([Link]("??"))
print([Link]("?"))
print([Link]("."))
False
True
True
False
In [4]: #class9 starts from here
#isnumeric() - check all given values are numeric aor not
a="123"
print([Link]())
a="abc"
print([Link]())
a="123abc"
print([Link]())
a=123
print([Link]())
True
False
False
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[4], line 9
7 print([Link]())
8 a=123
----> 9 print([Link]())
AttributeError: 'int' object has no attribute 'isnumeric'
In [6]: #isalpha() -check all given value are alphabets or not
a="abc"
print([Link]())
a="123abc"
print([Link]())
True
False
In [7]: #isalnum() - It checks 3 things 1. alphabets, [Link] , 3. alphanumeric . All the
abc="123gurukulam"
print([Link]())
alphabet="gurukulam"
print([Link]())
num="123"
print([Link]())
True
True
True
In [14]: #find() - it finds where the given strings are suitated and fetch the index of the
txt="welcomw to gurukula"
print([Link]("to"))
print([Link]("u"))
print([Link]("too")) # special case in find and ithis is not applicable for index
8
12
-1
In [13]: #index() - similar to find()
txt="welcomw to gurukula"
print([Link]("to"))
print([Link]("u"))
print([Link]("too"))
8
12
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[13], line 5
3 print([Link]("to"))
4 print([Link]("u"))
----> 5 print([Link]("too"))
ValueError: substring not found
In [17]: #replace() - it replaces the given strings with other strings
a="i love dogs"
print([Link]("love", "like"))
i like dogs
In [26]: #replace() - it replaces the given strings with other strings
a="i love dogs,i love flowers, i love parrots"
print([Link]("i", "we",2)) # it replace i in first two places only
print([Link]("i", "we"))
print([Link]("i", "we",1))
print([Link]("i", "we",3))
print([Link]("i", "we",0))
we love dogs,we love flowers, i love parrots
we love dogs,we love flowers, we love parrots
we love dogs,i love flowers, i love parrots
we love dogs,we love flowers, we love parrots
i love dogs,i love flowers, i love parrots
In [39]: #strip() ,lstrip(), rstrip()- whatever the special character mentioned inside the s
word="@#$python$$$@"
print([Link]("@$#"))
print([Link]("@$#")) # remove all mentioned special chartacters from left side
print([Link]("@$#")) # remove all mentioned special chartacters from right sid
python
python$$$@
@#$python
In [44]: #ljust(), rjust() and center() - it add the special character
word= "python"
print([Link](10,'$')) # 10 indicates the total numer of string length, python h
print([Link](10,'$'))
print([Link](10,'$'))
print([Link](11,'$'))
python$$$$
$$$$python
$$python$$
$$$python$$