Author Archives: Gurmeet Singh

Python Generators – Yield Statement, Expressions & Methods

Python Generators – Yield Statement & Expressions

This is a detailed tutorial of the Python Generators. Learn about yield statement, generator expressions and the send(), throw() and close() methods. What are Python Generators? These are a special kind of functions that instead of returning one value, at last, keeps the ability to return multiple values as the time passes and function processing […]

How to create a zip or tar archive in Python? (Tutorial)

Creating ZIP Or TAR Archive For A Given Directory

Learn to create a zip or tar archive of a particular directory in python using two different methods with the help of illustrative examples. You can also watch the following video presentation instead of reading this article. Creating ZIP or TAR Archive in Python Two different methods to create archives in Python are explained and […]

Python String rpartition() Method

Python String Rpartition() Method

This is a tutorial of the Python String rpartition() method. Learn to partition a given string into a 3-item tuple. (Left Part, Splitting Part, Right Part) Python String rpartition() This method returns a 3-element tuple for a given string such that it contains three parts created after splitting the original string from the last occurrence […]

Python String partition() Method

Python String Partition() Method

This is a tutorial of the Python String partition() method. Learn to partition a given string into a 3-item tuple. (Left Part, Splitting Part, Right Part) Python String partition() This method returns a 3-element tuple for a given string such that it contains three parts created after splitting the original string from the first occurrence […]

Python String rstrip() Method

Python String Rstrip() Method

This is a tutorial of the Python String rstrip() method. Learn to get the copy of a given string with specified trailing characters removed from it. Python String rstrip() This method returns a new copy of the given string in which the characters specified in the argument are removed from the trailing edge of the […]

Python String lstrip() Method

Python String Lstrip() Method

This is a tutorial of the Python String lstrip() method. Learn to get the copy of a given string with specified leading characters removed from it. Python String lstrip() This method returns a new copy of the given string in which the characters specified in the argument are removed from the leading edge of the […]

Python String upper() Method

Python String Upper() Method

This is a tutorial of the Python String upper() method. Learn to covert a given Python String into uppercase using this method with the help of examples. Python String upper() The str.upper() method returns a string in which all of the characters of a given Python String are converted into their uppercase forms. Note. The […]

Python String lower() Method

Python String Lower() Method

This is a tutorial of the Python String lower() method. Learn to covert a given Python String into lowercase using this method with the help of examples. Python String lower() The str.lower() method returns a string in which all of the characters of a given Python String are converted into their lowercase forms. Note. The […]

Python String rjust() Method

Python String Rjust() Method

This is a tutorial of the Python String rjust() method. Learn to get a given string right-justified for a given minimum width with the help of examples. Python String rjust() The str.rjust() the method returns a right-justified string that is of given minimum width. The returned string is a new string created from the contents […]

Python String ljust() Method

Python String Ljust() Method

This is a tutorial of the Python String ljust() method. Learn to get a given string left-justified for a given minimum width with the help of examples. Python String ljust() The str.ljust() the method returns a left-justified string that is of given minimum width. The returned string is a new string created from the contents […]