Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #1174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Master #1174

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions mycode.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
def is_prime(n):
"""
返回一个布尔值,判断参数n是否为质数

参数:
n (int): 需要检查的整数

返回值:
bool: 如果n是质数,返回True;否则返回False

"""
if n < 2:
return False
if n == 2:
return True
for m in range(2, int(n**0.5)+1):
if (n % m) == 0:
return False
else:
return True

print(is_prime(11))
def is_prime(n):
"""
Return a boolean value based upon
Expand Down