center() is an inbuilt method defined in the python string. Using this method, we can centre align a string. By default, we can centre align a string with space on its side. Or we can give specific characters as the fill character.
ReadSometimes we need to read a list of inputs from the user. For example, if our program needs a list of strings as an input from the user, we will have to ask the user to enter these values. We can get them one by one or all in one go. In this post, I will show you how to handle this situation in Python.
Readisspace() is used to check if a string contains all white space characters or not. If your program can't handle white spaces, this method really comes handy. For example, on your server, you can confirm a string before performing any operation on it.
ReadThree different ways to print the key-value pairs of a Python dictionary. We will learn to do it by using a loop, using the items() method and iterating through the keys of the dictionary.
ReadIn this python programming tutorial, we will learn how to solve a quadratic equation. The user will enter the values of the equation, our program will solve it and print out the result. The quadratic equation is defined as below :where, a,b, and c are real numbers and 'a' is not equal to zero. To find out the value of x, we have one equation called quadratic equation which is defined as below..
ReadIn this python programming tutorial, we will learn how to find the difference between two sets. The difference between set A and set B is a set that contains only the elements from set A those are not in set B. In this example, we will take the inputs from the user for both sets. The program will calculate the difference and print it out.
ReadIn this python programming tutorial, we will learn how to convert a kilometer value to miles. The program will take the kilometer input from the user, convert it and print out the result.
ReadIn this python programming tutorial, we will learn how to find out the perimeter of a triangle using user-provided values. The program will take the inputs from the user and print out the result.
ReadThis post will show you three different ways to find the largest divisor of a number in Python. We will learn how to use a for loop or how to use the next() function to calculate the largest divisor with examples.
ReadPython program to find the factors of a number. The program will take one number as the input from user and print out the factors for that number.
Read