• 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-607c712acb576962344835/] 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-607c712acbe1e404331099/] 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-607c712acc26f541299896/] 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-607c712acc57d592249818/] 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-607c712accc2b234543387/] 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-607c712accf3c377073590/] Output: listOfItems: [‘Clock’, ‘Bed’, ‘Fan’, ‘Table’] listOfItems in reversed order: [‘Table’, […]

  • 07 December

    Python List remove()

    In this tutorial, we will see about Python List‘s remove method.Python List remove method is used to remove passed element from the list.It will remove first matching element from the list. Python List remove syntax [crayon-607c712acd289445309856/] here list1 is object of list. Python List remove example You can simply call remove method to delete an […]

  • 07 December

    Python List sort()

    In this tutorial, we will see about Python List‘s sort method.Python List sort method is used to sort the list either in ascending or descending order. Python List sort syntax [crayon-607c712acd606991852438/] here list1 is object of list.As you can see key and reverse are optional parameters. Python List sort example You can simply call remove […]