The method isupper() checks whether all the case-based characters (letters) of the string are uppercase. [Read more…] about Python String isupper() Method
Python String isdecimal() Method
If all the characters in the string are decimal, the Python isdecimal() method returns True. Decimal characters are the characters of base 10. If not, False returns.
[Read more…] about Python String isdecimal() Method
Python String isdigit() Method
The method isdigit() returns True if all the characters are digits. It returns False if not.
[Read more…] about Python String isdigit() Method
Python String isnumeric() Method
The method isnumeric() checks whether the string consists of only numeric characters. This method is present only on unicode objects.
[Read more…] about Python String isnumeric() Method
Python String isalpha() Method
In Python, the isalpha() method returns true if all the string characters are alphabets. Otherwise, It returns “False.”
[Read more…] about Python String isalpha() Method
Python String isalnum() Method
The Python String isalnum() Method tests whether or not all characters are alphanumeric. A letter(a-z) or a number(0-9) character is classified as alphanumeric. Special chars, like spaces, are not permitted.
[Read more…] about Python String isalnum() Method
Python String isspace() Method
Python isspace() is a built-in method returns true if there are only whitespace characters in the string. Otherwise, it returns false. Space, newline, tabs, etc., are known as whitespace characters and defined in the Unicode character database as Other or Separator.
[Read more…] about Python String isspace() Method
Python String istitle() Method
Python String istitle() Method is used to verify the input string title condition, i.e., it tests and returns True if the only first character of each word is uppercase, and all other characters of each word are in lowercase.
[Read more…] about Python String istitle() Method
Python String rjust() Method
Python rjust() method returns the right-justified string and fill the remaining spaces with specified fillchar.
[Read more…] about Python String rjust() Method
Python String ljust() Method
Python ljust() method returns a left-justified string and fills the remaining spaces with specified fillchar (default is a space). This method returns a new left-justified string and is filled with fillchars. The original string is returned if the width is less than len(s).
[Read more…] about Python String ljust() Method
Python String center() Method
The Python center() method aligns the string center with the string’s left and right padding. This function takes two parameters, the first is the width, and the second is an optional fillchar. The fillchar is a character used for padding the string to the left and right. [Read more…] about Python String center() Method
Python String zfill() Method
The Python zfill() method fills the string left with zero. The original length of the string is returned if the width is shorter than the string length.
[Read more…] about Python String zfill() Method
Python String find() Method
The find() method of the Python string returns the first matched index of the substring. It returns -1 if not found.
[Read more…] about Python String find() Method
Python String index() Method
It determines if string str occurs in string or in a substring of string if starting index beg and ending index end are given. This method is same as find(), but raises an exception if sub is not found.
[Read more…] about Python String index() Method
Python String rfind() Method
The Python String rfind() Method identifies the substring and returns the last index. It returns the index of the string’s rightest matched substring. It returns -1 if there is no such index.
[Read more…] about Python String rfind() Method
Python String replace() Method
The method replace() is a built-in function in Python programming that returns all the old substring occurrences with the new substring, optionally restricting the number of replacements to the max.
[Read more…] about Python String replace() Method
Python String split() Method
Python string split() method returns a comma-separated list, using separator delimiter. The two parameters of this approach are optional. [Read more…] about Python String split() Method
Python String splitlines() Method
The method splitlines() returns a list with all the lines in string, optionally including the line breaks (if num is supplied and is true) [Read more…] about Python String splitlines() Method
Python String join() Method
The join() method is used to join separator items to the input string. It accepts as parameters iterables such as collection, list, tuple, string, etc., and another string.
The join() function returns a string that joins the iterable elements to the separator string passed on to the function as an argument. [Read more…] about Python String join() Method
Python String expandtabs() Method
Python String expandtabs() Method returns a copy of the string in which tab characters ie. ‘\t’ are expanded using spaces, optionally using the given tabsize (default 8). [Read more…] about Python String expandtabs() Method
Python’s encode and decode Methods
The encode() method returns an encoded string. Strings preserved as Unicode after Python 3.0. python encode utf-8 use if no encoding is defined. [Read more…] about Python’s encode and decode Methods
Python String Min and Max Methods
Python min() function is used to get the min alphabetical character from the string. The Python max() function returns the max alphabetical character from the string. It can also use to find the most considerable item between two or more parameters.
[Read more…] about Python String Min and Max Methods
Python String maketrans() Method
Python string maketrans() method returns a mapping table that maps every character in the intab string in the same place in the outtab string. This table is then moved to the translate() function. [Read more…] about Python String maketrans() Method
Python String translate() Method
The Python translate() method returns a copy of the string in which a specified translation table is used to map each character. We may use the maketrans() method to construct a chart of translation in various formats from character to character mappings.
[Read more…] about Python String translate() Method
Python String rindex () Method
Python rindex() method returns the last index of the substring inside the string. Otherwise, it raises an exception. [Read more…] about Python String rindex () Method
Python String strip() Method
The Python String strip() Method returns a copy of the string by stripping both the beginning and the string’s end.
[Read more…] about Python String strip() Method
Data Structures in Python
Data Structures in Python describe how data should organize and stored efficiently to solve a computational problem while making their storage (space) complexity and time complexity as optimized as possible. Let us go through the topics we will cover in Data Structures in Python. [Read more…] about Data Structures in Python
File handling in Python
File handling in Python (also known as Python I/O) involves the reading and writing process and many other file handling options. The built-in Python methods can manage two file types, text and binary files, but they encode data differently. [Read more…] about File handling in Python
Python if…else Statement
In this tutorial, you will learn decision-making using different if-else statements in the Python programming language. Let’s one by one explore them. [Read more…] about Python if…else Statement
While loop in Python
A while loop in Python is a control flow statement that repeatedly executes a block of statements based on a given boolean condition. In this tutorial, you will learn how to create a while loop in Python. [Read more…] about While loop in Python