Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 17, 2020 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/f3254195db6743cb06a67f6a8646c691 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/f3254195db6743cb06a67f6a8646c691 to your computer and use it in GitHub Desktop.
t=('red','blue','green','red')
#Returns the count of 'red' in the tuple.
print (t.count('red')) #Output: 2
t2=(1,2,3,[1,2,3],[1,2,3,4,5])
print (t2.count(1))#Output: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment