![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 27104 Articles for Server Side Programming
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
822 Views
This is a language agnostic question. Loops are there in almost every language and the same principles apply everywhere. You need to realize that compilers do most heavy lifting when it comes to loop optimization, but you as a programmer also need to keep your loops optimized.It is important to realize that everything you put in a loop gets executed for every loop iteration. They key to optimizing loops is to minimize what they do. Even operations that appear to be very fast will take a long time if the repeated many times. Executing an operation that takes 1 microsecond ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
328 Views
There is no special .. ("dot dot") notation syntax in python. You can, however, see this in case of floats accessing their properties. For example,f = 1..__truediv__ # or 1..__div__ for python 2 print(f(8))This will give the output:0.125What we have is a float literal without the trailing zero, which we then access the __truediv__ method of. It's not an operator in itself; the first dot is part of the float value, and the second is the dot operator to access the object's properties and methods. This can also be achieved using:>>> f = 1. >>> f 1.0 >>> f.__truediv__
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
778 Views
If you want to get an inversion of only first 16 bits of a number, you can take a xor of that number with 65535(16 1s in binary). Forgetting a 2s complement, just add one to the result. For example,Examplea = 3 # 11 in binary b = (a ^ 65535) + 1 print(bin(b))OutputThis will give the output:0b1111111111111101
![Sai Subramanyam](https://www.tutorialspoint.com/assets/profiles/13512/profile/60_68191-1512710774.jpg)
104 Views
Python and most mainstream languages do not allow changing how operators look. If you're trying to replace something like a == b with a equals b, you can't do that. In Python the restriction is quite intentional — an expression such as a equals b would look ungrammatical to any reader familiar with Python.
![Vikram Chiluka](https://www.tutorialspoint.com/assets/profiles/495654/profile/60_4081994-1659334126.jpg)
145 Views
In this article, we will explain the correct name of the * operator available in python. In Python, you'll encounter the symbols * and ** used frequently. Many Python programmers, especially those at the intermediate level, are confused by the asterisk (*) character in Python. The *args argument is called the "variable positional parameter" and **kwargs is the "variable keyword parameter". The * and ** arguments just unpack their respective data structures.Using Asterisk ( * ) Operator in Multiplication Algorithm (Steps) Following are the Algorithm/steps to be followed to perform the desired task − Create two variables and ... Read More
![Vikram Chiluka](https://www.tutorialspoint.com/assets/profiles/495654/profile/60_4081994-1659334126.jpg)
9K+ Views
In this article, we will show you how to append a tuple into another in python. Below are the various methods to accomplish this task − Using + operator. Using sum() function. Using list() & extend() functions. Using the unpacking(*) operator. Tuples are an immutable, unordered data type used to store collections in Python. Lists and tuples are similar in many ways, but a list has a variable length and is mutable in comparison to a tuple which has a fixed length and is immutable. Using + operator Algorithm (Steps) Following are the Algorithm/steps to be followed to ... Read More
![Vikram Chiluka](https://www.tutorialspoint.com/assets/profiles/495654/profile/60_4081994-1659334126.jpg)
21K+ Views
In this article, we will show you how to represent a tuple in python in JSON format. We will see the below-mentioned methods in this article: Converting Python Tuple to JSON Converting Python Tuple with Different Datatypes to JSON String Parsing JSON string and accessing elements using json.loads() method. Convert the dictionary of tuples to JSON using json.dumps() What is JSON? JSON (JavaScript Object Notation) is a simple lightweight data-interchange format that humans can read and write. Computers can also easily parse and generate it. JSON is a computer language that is based on JavaScript. It is a ... Read More
![Vikram Chiluka](https://www.tutorialspoint.com/assets/profiles/495654/profile/60_4081994-1659334126.jpg)
8K+ Views
In this article, we will show you how to convert a Python tuple to a C array in python. Python does not have a built-in array data type like other programming languages, but you can create an array by using a library like Numpy. Below are the various methods to convert a tuple into an array in Python − Using numpy.asarray() method Use numpy.array() method If you have not already installed NumPy on your system, run the following command to do so. pip install numpy Convert tuple to array using numpy.asarray() Use the np.asarray() function to convert ... Read More
![Vikram Chiluka](https://www.tutorialspoint.com/assets/profiles/495654/profile/60_4081994-1659334126.jpg)
11K+ Views
In this article, we will show you how to convert bytes to a string in python. Below are the various methods to accomplish this task − Using decode() function Using str() function Using codecs.decode() function Using pandas library Using decode() function The built-in decode() method in python, is used to convert bytes to a string. Algorithm (Steps) Following are the Algorithm/steps to be followed to perform the desired task –. Create a variable to store the input byte string data. Print input data. Use the type() function(returns the data type of an object) to print the type ... Read More