Posts

Showing posts from October, 2021

Tuple Functions in Python

Image
  A tuple functions in python is one of four  erected -in data  types  in Python  used  to  store   collections  of data. Tuple  operations  are those that can  be   performed  on the  rudiments  in the tuple data  structure .  Let  us  look  at some of the most  extensively   used  tuple  operations  in Python. 1.  Count   Circumstances  of an  Element  in a Tuple count  ()  system  is  used  to  count  the  total   circumstances  of an  element  in thetuple.However,  also  the  function  returns 0, If the  element  isn't  plant  in the tuple. tup1 = (1, 4, 7, 3, 6, 4, 1, 8, 4) .#  counts   number  of  times  4 occurs in the tuple print  (tup1.count (4)) # prints 3 2.  Chancing  the  Position  of an  Element  in a Tuple You can  use  the  indicator  ()  system  to  find  the  indicator /  position  of an  element  in thetuple.However,  also  the  function  returns the  indicator  of the  first   circumstance , If there are  further  than one  circumstances  of an  element  in the