functions,meathods
functions,meathods
string.capitalize()
Purpose: for converting first character in upper case
Parameters taking: None
Returns: capitalized version of the string (string
value)
string.casefold()
Purpose: to convert all character in lower case
Parameters taking: None
Returns: Return a version of the string
string.format (value1,value2,…)
The placeholders can be identified using named
indexes {price}, numbered indexes {0}, or even empty
placeholders {}.
Purpose: formats the specified value(s) and insert them
inside the string's placeholder.
Parameters taking: 1.value, value2 Required can be any
data type
Returns: formatted string value
string.ascii()
Purpose: to find in string all values having ascii
value
Parameters : not required any parameters
string.isdecimal()
Purpose: to find I string all valuses having decimal
value
Parameter taking: not requires any parameters
Returns: it return bool value
string.isdigit()
Purpose: to find all characters in string are in digits
Parameter taking: not required any parameters
Returns: it return bool value
string.isidentifier()
Purpose: To find string is a valid Python identifier
Parameter taking: not required any parameters
Returns: it returns bool value
String.islower()
Purpose: To find the all string is a lowercase string
Symbol,space are not checked only alphabets are checked
Parameter taking: not Required any parameters
Returns: it returns bool value
string.isnumeric()
Purpose: To find all the string is a numeric string
(+,-,*)is not concider as numeric value only(0-
9)numbers
Parameter taking: not required any parameters
Returns: it returns bool value
string.isprintable()
Purpose: to find all the string is printable
Parameter taking: not required any parameters
Returns: it returns bool value
string.isspace()
Purpose: to find the string having empty mean ‘ ‘
string
Parameters taking: not required nay parameters
Returns: it returns bool value
string.istitle()
Purpose: to find the all strings first character is in
capital letters symbols and numbers are ignored
Parameters taking: not required any parameters
String.isupper()
Purpose: to find the all strings characters in capital
letters numbers symbols add space are not checked
Parameters taking: not required nay parameters
Return: its returns bool value
string.join(iterable)
Purpose: to Concatenate any number of strings
Parameters taking: 1.Iterable object Required
Return: tis return string value
When using a dictionary as an iterable, the returned
values are the keys, not the values.
string.ljust(length, character)
Purpose: To padding is done using the specified fill
character
Parameter taking:1.lingth int value required,2.single
character str value optional default is space
Return: its return string value
str.maketrans(x, y, z)
Purpose:
Parameters takin:
Return:
str.partition(value)
Purpose: make Partition the string into three parts
using the given separator
This method searches for the first occurrence of the
specified string.
Parameters taking:1. Value str required
Return: its return tuple
str.replace(oldvalue, newvalue, count)
Purpose: all occurrences of substring old replaced by
new.
Parameters taking: 1,required oldvalue str
value ,2.required new value str, 3.count value int
optional default is all occurrence
Return: its returns string value
any(iterable)
Purpose: to find out any object in the iterable are
true or not
If the iterable is empty(), return False
When used on a dictionary, the any() function checks if
any keys are true, not the values.
Arguments: 1.Iterable optional
Return: bool value
ascii(object)
Purpose: to find out the ascii value of the object
Arguments taking: 1. Object required
Return: ascii converted value
bin(n)
Purpose: To convert value into binary form
Argument taking: 1 n int Required
Return: binary representation of an integer.in string
value
bool(object)
Purpose: to convert object into boolian value
Argument taken: 1. Object optional
Return: bool value
bytearray(x, encoding, error)
Purpose: To convert bytearray
Argument taken:
Return: it returns bytearray value
bytes (x, encoding, error)
Purpose:
The difference between bytes() and bytearray() is
that bytes() returns an object that cannot be modified,
and bytearray() returns an object that can be modified.
Argument taken:
Return: bytes value
callable(Object)
Purpose: to check object is callable or not
Argument taken: 1.object required
Return: boolian value
chr(number)
Purpose: returns the character that represents the
specified unicode.