This article will be discussing the process of using string variables in Python.
This is part three in a series discussing everything required to get an all-encompassing grasp of the Python programming language in as short a time as possible. Whether you are a beginner or an expert, I intend for you to learn something new. I will not be going into details on packages that need to be downloaded and so everything will be vanilla Python.
"This is a string" 'This is a string' '''This is a string'''
Strings are denoted in Python by either a set of one single, one double or three single quotes. A set of three single quotes is used for strings that span multiple lines, while the other two types can be used interchangeably.
Joining two strings together is called concatenation.
"This is" + " a string" "string " * 4
Using a plus sign in a string simply takes the two strings and joins them together at that point.
Using a multiply sign after a string simply chains the string together as many times as specified.
Python is an interpreted, high-level, powerful general-purpose programming language. You may ask, Python’s a snake right? and Why is this programming language named after it?
Guide to Python Programming Language
Today you're going to learn how to use Python programming in a way that can ultimately save a lot of space on your drive by removing all the duplicates. We gonna use Python OS remove( ) method to remove the duplicates on our drive. Well, that's simple you just call remove ( ) with a parameter of the name of the file you wanna remove done.
In this tutorial, you’re going to learn a variety of Python tricks that you can use to write your Python code in a more readable and efficient way like a pro.
Magic Methods are the special methods which gives us the ability to access built in syntactical features such as ‘<’, ‘>’, ‘==’, ‘+’ etc.. You must have worked with such methods without knowing them to be as magic methods. Magic methods can be identified with their names which start with __ and ends with __ like __init__, __call__, __str__ etc. These methods are also called Dunder Methods, because of their name starting and ending with Double Underscore (Dunder).