Everything in python is an object. An object has a type, which defines its attributes and methods. For example the
str type, define the attributes and methods for a string object. An object has also an
id, which is … Read More
If there is a string , which must be reversed , for example :
reverse of '' is ''
reverse of 'a' is 'a'
reverse of 'ab' is 'ba'
In python this can be done like this :
… Read More
The ones’ complement operator
~ , will flip the bits of an integer , so one will become zero , and zero will become one. An integer in python , has :
- an unlimited number of bits .
… Read More
What is a character in python ?
A character in python is represented using a Unicode code point. A Unicode code point is written by using
U+ followed by a number written in hexadecimal . This number written in hexadecimal … Read More
What is a generator
A generator simply generates data that we are going to use someplace. For example ,if we want to generate some random characters , or if we want to generate a number in a mathematical series , … Read More
In python , we have the class type , and we have the class object .
The class type is used to create a new type/class .
The class type is also used to get the type/class used to create … Read More
what is an iterable ?
In python , objects are abstraction of data , they have methods that work with data , and help us to manipulate it . If we take a look at a list , and see … Read More
In this tutorial , we will show how to use sets in python . We will start by explaining what is a set. After that we will explain how to use sets , so the various operations that we can … Read More
The timeIt module is used to test how fast our code is . We can use it to compare different functions or classes or just some line of code ,and see how fast they are .Also if we want we … Read More