Skip to main content

A sample hamidshah

Project description

Count in List 🧮

A simple Python function that counts how many times a given word appears in a list using the collections.Counter class.

Example

from collections import Counter

def count_in_list(l, word):
    c = Counter(l)
    return c[word]

words = ["apple", "banana", "apple", "cherry", "banana", "apple"]
print(count_in_list(words, "apple"))  # Output: 3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hamidshah-0.0.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hamidshah-0.0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file hamidshah-0.0.1.tar.gz.

File metadata

  • Download URL: hamidshah-0.0.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for hamidshah-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d71e6f619898de48eedfabb0c96482ad4822e4da225818db0a02eea04259b2e1
MD5 7b3ca68e407df6c66d8739ecad59244a
BLAKE2b-256 77342e2567eab1eed6337e8382d68bf41e6ef34ee2dcceb9b684b8e554d65fe8

See more details on using hashes here.

File details

Details for the file hamidshah-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: hamidshah-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for hamidshah-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b5a89ed60a3197ab557582184635ebd7f56862659acc33be9ef250d55d953c4
MD5 51a3f0f7221065b30bf187f6db59982d
BLAKE2b-256 d82194b770e16e23cf82bf14818783718276b136284b1b2707f881ba235b34af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page