Python Tutorial ( PDFDrive )
Syntax Following is the syntax for isupper() method:str.isupper()Parameters • NAReturn Value This method returns true if all cased characters in the string are uppercase and there is at least one casedcharacter, false otherwise.Example The following example shows the usage of isupper() method.#!/usr/bin/pythonstr = "THIS IS STRING EXAMPLE....WOW!!!";print str.isupper();str = "THIS is string example....wow!!!";print str.isupper();Let us compile and run the above program, this will produce the following result:TrueFalsejoin(seq) Description The method join() returns a string in which the string elements of sequence have been joined by strseparator.Syntax Following is the syntax for join() method:str.join(sequence)Parameters • sequence -- This is a sequence of the elements to be joined.Return Value This method returns a string, which is the concatenation of the strings in the sequence seq. The separatorbetween elements is the string providing this method.Example The following example shows the usage of join() method.#!/usr/bin/pythonTUTORIALS POINT Simply Easy Learning
str = "-";seq = ("a", "b", "c"); # This is sequence of strings.print str.join( seq );Let us compile and run the above program, this will produce the following result:a-b-clen(string) Description The method len() returns the length of the string.Syntax Following is the syntax for len() method:len( str )Parameters • NAReturn Value This method returns the length of the string.Example The following example shows the usage of len() method.#!/usr/bin/pythonstr = "this is string example....wow!!!";print "Length of the string: ", len(str);Let us compile and run the above program, this will produce the following result:Length of the string: 32ljust(width[, fillchar]) DescriptionThe method ljust() returns the string left justified in a string of length width. Padding is done using thespecified fillchar (default is a space). The original string is returned if width is less than len(s).Syntax Following is the syntax for ljust() method:TUTORIALS POINT Simply Easy Learning
- Page 89 and 90: 11 is prime13 is prime17 is prime19
- Page 91 and 92: continue statement The continue st
- Page 93 and 94: CHAPTER8Python NumbersNumber data t
- Page 95 and 96: max(x1, x2,...)min(x1, x2,...)modf(
- Page 97 and 98: Syntax Following is the syntax for
- Page 99 and 100: import math# This will import math
- Page 101 and 102: import mathmath.log10( x )Note: Thi
- Page 103 and 104: modf(x) Description The method modf
- Page 105 and 106: round( x [, n] )Parameters • x --
- Page 107 and 108: Return Value This method returns a
- Page 109 and 110: seed([x]) Description The method se
- Page 111 and 112: Syntax Following is the syntax for
- Page 113 and 114: asin(x)Note: This function is not a
- Page 115 and 116: print "atan2(-10,10) : ", math.atan
- Page 117 and 118: Note: This function is not accessib
- Page 119 and 120: import mathprint "degrees(3) : ", m
- Page 121 and 122: CHAPTER9Python StringsStrings are a
- Page 123 and 124: + Concatenation - Adds values on ei
- Page 125 and 126: TAB ( \t ) and they will show up th
- Page 127 and 128: 14151617181920212223242526272829303
- Page 129 and 130: str = "this is string example....wo
- Page 131 and 132: Return Value This method returns a
- Page 133 and 134: Description The method expandtabs()
- Page 135 and 136: Traceback (most recent call last):F
- Page 137 and 138: Let us compile and run the above pr
- Page 139: str = "This is string example....wo
- Page 143 and 144: lstrip() Description The method lst
- Page 145 and 146: Max character: xmin(str) Descriptio
- Page 147 and 148: str = "this is really a string exam
- Page 149 and 150: Parameters • chars -- You can sup
- Page 151 and 152: Parameters• str -- This is the st
- Page 153 and 154: Parameters • NAReturn Value This
- Page 155 and 156: Example The following example shows
- Page 157 and 158: CHAPTER10Python ListsThe most basic
- Page 159 and 160: Python Expression Results Descripti
- Page 161 and 162: Syntax Following is the syntax for
- Page 163 and 164: list( seq )Parameters • seq -- Th
- Page 165 and 166: Return Value If elements are of th
- Page 167 and 168: list.insert(index, obj)Parameters
- Page 169 and 170: Syntax Following is the syntax for
- Page 171 and 172: CHAPTER11Python TuplesAtuple is a s
- Page 173 and 174: len((1, 2, 3)) 3 Length(1, 2, 3) +
- Page 175 and 176: -11-1len(tuple) Description The met
- Page 177 and 178: min value element : 200tuple(seq) D
- Page 179 and 180: #!/usr/bin/pythondict = {'Name': 'Z
- Page 181 and 182: 34str(dict)Produces a printable str
- Page 183 and 184: type(variable) Description The meth
- Page 185 and 186: Syntax Following is the syntax for
- Page 187 and 188: Syntax Following is the syntax for
- Page 189 and 190: Return Value This method does not
Syntax
Following is the syntax for isupper() method:
str.isupper()
Parameters
• NA
Return Value
This method returns true if all cased characters in the string are uppercase and there is at least one cased
character, false otherwise.
Example
The following example shows the usage of isupper() method.
#!/usr/bin/python
str = "THIS IS STRING EXAMPLE....WOW!!!";
print str.isupper();
str = "THIS is string example....wow!!!";
print str.isupper();
Let us compile and run the above program, this will produce the following result:
True
False
join(seq)
Description
The method join() returns a string in which the string elements of sequence have been joined by strseparator.
Syntax
Following is the syntax for join() method:
str.join(sequence)
Parameters
• sequence -- This is a sequence of the elements to be joined.
Return Value
This method returns a string, which is the concatenation of the strings in the sequence seq. The separator
between elements is the string providing this method.
Example
The following example shows the usage of join() method.
#!/usr/bin/python
TUTORIALS POINT
Simply Easy Learning