Combine two lists Python | Example code
Use the + operator to Combine two lists in Python. There are many ways to join or concatenate, two or more lists in Python. Like,… Read More »Combine two lists Python | Example code
Use the + operator to Combine two lists in Python. There are many ways to join or concatenate, two or more lists in Python. Like,… Read More »Combine two lists Python | Example code
Use not-operator expression in if statement to check string not empty in Python. Python string not empty example Simple example code. Output: Another example with… Read More »Python string not empty | Example code
While 1 is a bit kinder to old versions of Python. While 1 will create an infinite loop in Python. The most pythonic way will… Read More »While 1 in Python Example | Code
Using the if statement you can find the function returned true or not in Python. This step is needed some time in order to proceed… Read More »Python check if the function returns True | Example code
The best and easy way to find the last character in a string is negative indexing. Every character in a string has an index number… Read More »Python find last character in string | Example code
Python has many methods to convert a character or string entered by the user from uppercase to lowercase. The best way is to use the… Read More »Write a program to read a character in Uppercase and print it in lowercase in Python
Use string index() to find the substring index value. This method returns the index of a substring inside the string (if found). Get substring index… Read More »Python substring index get (find) | Example code
Use slicing or rstrip() method to delete the last character of string in Python. You can also use regular expression or loop for it but it… Read More »Python string delete last character | Example code
Using a negative number as an index in the slice method is called Negative slicing in Python. It returns the nth element from the right-hand… Read More »Negative slicing in Python | Example code
Doing slicing will extract part of a string in Python. Use square-bracket syntax with the starting position of the piece we want, but also where… Read More »Python extract part of a string | Example code