forked from realpython/materials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprime.py
More file actions
27 lines (21 loc) · 689 Bytes
/
prime.py
File metadata and controls
27 lines (21 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Prompt
Write a Google-style docstring for a function that takes an
integer as an argument and determines whether it’s a prime
number.
"""
# Output:
def is_prime_number(n):
"""
Determines if an input integer is a prime number.
This function takes an integer as an argument and checks
whether it is a prime number. A prime number is a
positive natural number greater than 1 that has no positive
integer divisors other than 1 and itself.
Args:
n (int): The integer to check.
Returns:
bool: True if the input integer is a prime number,
False otherwise.
Raises:
ValueError: If n is less than or equal to 1.
"""