python | Twise Random https://twiserandom.com A site about computer science . Wed, 01 Sep 2021 19:39:07 +0000 en-US hourly 1 https://wordpress.org/?v=5.8.1 https://twiserandom.com/wp-content/uploads/2019/08/cropped-abstract-color-32x32.jpg python | Twise Random https://twiserandom.com 32 32 __eq__ , __ne__ , __lt__ , __gt__ , __ge__ , __le__ in python a tutorial https://twiserandom.com/python/__eq__-__ne__-__lt__-__gt__-__ge__-__le__-in-python-a-tutorial/ Wed, 01 Sep 2021 10:56:45 +0000 https://twiserandom.com/?p=8284 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

The post __eq__ , __ne__ , __lt__ , __gt__ , __ge__ , __le__ in python a tutorial first appeared on Twise Random.]]>
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

The post __eq__ , __ne__ , __lt__ , __gt__ , __ge__ , __le__ in python a tutorial first appeared on Twise Random.]]>
Reverse a string in python recursively https://twiserandom.com/python/reverse-a-string-in-python-recursively/ Sat, 11 Jul 2020 20:15:45 +0000 https://twiserandom.com/?p=833 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 :

>>> ''.join(reversed('ab'))

Read More

The post Reverse a string in python recursively first appeared on Twise Random.]]>
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 :

>>> ''.join(reversed('ab'))
Read More The post Reverse a string in python recursively first appeared on Twise Random.]]>
The Ones’ complement operator ~ in python a tutorial https://twiserandom.com/python/operators-python/the-ones-complement-operator-in-python-a-tutorial/ Wed, 09 Oct 2019 16:05:30 +0000 https://twiserandom.com/?p=1407  

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 .
  • is

Read More

The post The Ones’ complement operator ~ in python a tutorial first appeared on Twise Random.]]>
 

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 .
  • is
Read More The post The Ones’ complement operator ~ in python a tutorial first appeared on Twise Random.]]>
what is a character in python ? https://twiserandom.com/python/what-is-a-character-in-python/ Mon, 05 Aug 2019 10:14:17 +0000 https://twiserandom.com/?p=518 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

The post what is a character in python ? first appeared on Twise Random.]]>
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

The post what is a character in python ? first appeared on Twise Random.]]>
reversed in python , a tutorial https://twiserandom.com/python/reversed-in-python-a-tutorial/ Tue, 30 Jul 2019 12:17:11 +0000 https://twiserandom.com/?p=429

What is reversed?

The reversed class is used to create a reverse iterator from an object .

This object , must either implement the __getitem__ and the __len__ special methods . In this case reverse will create an iterator from

Read More

The post reversed in python , a tutorial first appeared on Twise Random.]]>

What is reversed?

The reversed class is used to create a reverse iterator from an object .

This object , must either implement the __getitem__ and the __len__ special methods . In this case reverse will create an iterator from

Read More The post reversed in python , a tutorial first appeared on Twise Random.]]>
Generators in python , a tutorial https://twiserandom.com/python/generators-in-python-a-tutorial/ Sun, 28 Jul 2019 12:21:10 +0000 https://twiserandom.com/?p=422 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

The post Generators in python , a tutorial first appeared on Twise Random.]]>
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

The post Generators in python , a tutorial first appeared on Twise Random.]]>
what is an object in python ? https://twiserandom.com/python/what-is-an-object-in-python/ Wed, 24 Jul 2019 07:40:40 +0000 https://twiserandom.com/?p=397 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

The post what is an object in python ? first appeared on Twise Random.]]>
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

The post what is an object in python ? first appeared on Twise Random.]]>
Python iterable and iterator a tutorial https://twiserandom.com/python/python-iterable-and-iterator-a-tutorial/ Wed, 17 Jul 2019 20:45:36 +0000 https://twiserandom.com/?p=248 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

The post Python iterable and iterator a tutorial first appeared on Twise Random.]]>
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

The post Python iterable and iterator a tutorial first appeared on Twise Random.]]>
Sets in python a tutorial https://twiserandom.com/python/sets-in-python-a-tutorial/ Thu, 11 Jul 2019 02:59:09 +0000 https://twiserandom.com/?p=133 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 post Sets in python a tutorial first appeared on Twise Random.]]>
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 post Sets in python a tutorial first appeared on Twise Random.]]>
How To Use The TimeIt Module in python https://twiserandom.com/python/modules/how-to-use-the-timeit-module-in-python/ Sun, 07 Jul 2019 00:26:36 +0000 https://twiserandom.com/?p=108 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

The post How To Use The TimeIt Module in python first appeared on Twise Random.]]>
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

The post How To Use The TimeIt Module in python first appeared on Twise Random.]]>