Skip to content

Commit

Permalink
Update Count-Prime-Numbers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadiShadab authored Jan 10, 2025
1 parent f309610 commit 3b22a47
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions solutions/Count-Prime-Numbers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
r"""
This module defines the functions `is_prime` and `count_primes` for checking primality
and counting prime numbers in a list.
Expand All @@ -9,7 +9,7 @@
"""

def is_prime(n: int) -> bool:
"""
r"""
Checks if a given number is prime.
Parameters:
Expand Down Expand Up @@ -39,9 +39,8 @@ def is_prime(n: int) -> bool:
return False
return True


def count_primes(numbers: list) -> int:
"""
r"""
Counts the number of prime numbers in a list.
Parameters:
Expand All @@ -67,7 +66,6 @@ def count_primes(numbers: list) -> int:
prime_count += 1
return prime_count


# Example usage
numbers = [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]
print("Number of prime numbers:", count_primes(numbers))
Expand Down

0 comments on commit 3b22a47

Please sign in to comment.