• 08 December

    Python Convert list to set

    In this tutorial, we will see how to convert list to set. You can use python set() function to convert list to set.It is simplest way to convert list to set. As Set does not allow duplicates, when you convert list to set, all duplicates will be removed in the set. Let’s understand with the […]

  • 08 December

    How to create an empty list in python

    In this post, we will see how to create an empty list in python. There are two ways to create an empty list in Python. Using [ ] Using list() function. Let’s see this with the help of example. [crayon-6636d012d7873703809561/] Output: List 1: [1, 2] List 2: [1, 2] Which is faster: [ ] or […]

  • 08 December

    convert set to list Python

    In this tutorial, we will see how to convert set to list in python. You can use python list() function to convert set to list.It is simplest way to convert set to list. Let’s understand with the help of example. [crayon-6636d012d80bf236510912/] Output: set of Fruits: {‘Apple’, ‘Banana’, ‘Orange’} listOfFruits: [‘Apple’, ‘Banana’, ‘Orange’] set of scales: […]

  • 08 December

    Python tuple index()

    In this post, we will see about Python tuple’s index method.Python tuple’s index method is used to find index of element in the tuple Python tuple count syntax [crayon-6636d012d822d869012043/] tuple1 is object of the tuple and element is the object which you want to get index. Python tuple count example Python tuple index method is […]

  • 08 December

    Python tuple count()

    In this post, we will see about Python tuple’s count method.Python tuple’s count method is used to count the occurrences of element in the tuple. Python tuple count syntax [crayon-6636d012d8bfc982022657/] tuple1 is object of the tuple and element is the object which you want to get count. Python tuple count example Let’s understand count method […]

  • 07 December

    python – check if list is empty

    In this post, we will see how to check if list is empty in python. It is very easy to check if list is empty in python. You can use "not" to check if list is empty in Python. Let’s understand with the help of simple example. [crayon-6636d012d950f469547275/] Output: list1 is not empty list2 is […]

  • 07 December

    Python List append()

    In this tutorial, we will see about Python List‘s append method.Python List append is used to add single element to end of the list. Let’s understand about basic of python list first. Python List is nothing but the collection of elements. You can add any data type to the list. You can create simple list […]

  • 07 December

    Python List pop()

    In this tutorial, we will see about Python List‘s pop method.Python List pop method is used to remove and return the element at specified index. Python List insert syntax [crayon-6636d012d9bf1801175391/] here list1 is object of list. Python List pop example You can simply use pop method to remove and return element at given index.If you […]

  • 07 December

    Python List reverse()

    In this tutorial, we will see about Python List‘s reverse method.Python List reverse method is used to reverse the list. Python List reverse example You can simply call reverse method to reverse the list. Let’s understand this with the help of simple example. [crayon-6636d012da13a385847230/] Output: listOfItems: [‘Clock’, ‘Bed’, ‘Fan’, ‘Table’] listOfItems in reversed order: [‘Table’, […]