1 Star 0 Fork 0

mxfggg/the-craft-of-selfteaching

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mycode.py 761 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaolai 提交于 2019-03-14 22:31 . first commit
def is_prime(n):
"""
Return a boolean value based upon
whether the argument n is a prime number.
"""
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
def say_hi(*names, greeting='Hello', capitalized=False):
"""
Print a string, with a greeting to everyone.
:param *names: tuple of names to be greeted.
:param greeting: 'Hello' as default.
:param capitalized: Whether name should be converted to capitalzed before print. False as default.
:returns: None
"""
for name in names:
if capitalized:
name = name.capitalize()
print(f'{greeting}, {name}!')
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mxfggg/the-craft-of-selfteaching.git
[email protected]:mxfggg/the-craft-of-selfteaching.git
mxfggg
the-craft-of-selfteaching
the-craft-of-selfteaching
master

搜索帮助