【Python CheckiO 题解】I Love Python!


CheckiO 是面向初学者和高级程序员的编码游戏,使用 Python 和 JavaScript 解决棘手的挑战和有趣的任务,从而提高你的编码技能,本博客主要记录自己用 Python 在闯关时的做题思路和实现代码,同时也学习学习其他大神写的代码。

CheckiO 官网:https://checkio.org/

我的 CheckiO 主页:https://py.checkio.org/user/TRHX/

CheckiO 题解系列专栏:https://itrhx.blog.csdn.net/category_9536424.html

CheckiO 所有题解源代码:https://github.com/TRHX/Python-CheckiO-Exercise


题目描述

【I Love Python!】:练习函数的调用,定义一个函数,返回字符串“I Love Python!”

【链接】https://py.checkio.org/mission/i-love-python/

【输入】:Nothing

【输出】:字符串

【范例】

i_love_python() == "I love Python!"

代码实现

def i_love_python():
    """
        Let's explain why do we love Python.
    """
    return "I love Python!"


if __name__ == '__main__':
    # These "asserts" using only for self-checking and not necessary for auto-testing
    assert i_love_python() == "I love Python!"

大神解答

看看各个国家的语言

# Select your language in which you want to say "I Love Python!"
# By default it answers in english.
def i_love_python(language="English"):    
    if language == "Binary": return "01000010011001010010000001110011011101010111001001100101001000000111010001101111001000000110010001110010011010010110111001101011001000000111100101101111011101010111001000100000010011110111011001100001011011000111010001101001011011100110010100101110"
    if language == "Deutsch": return "Ich liebe Python!"
    if language == "English": return "I love Python!"
    if language == "Español": return "Me Encanta Python!"
    if language == "Espéranto": return "Αγαπώ Python!"
    if language == "Elf": return "Amin mela Python!"
    if language == "Ελληνική": return "Αγαπώ Python!"
    if language == "Français": return "J'aime Python !"
    if language == "Italiano": return"Adoro Python!"
    if language == "русский": return "Я люблю Python !"
    if language == "L337 Speak": return "1 L0\/3 p'/7|-|0|\|!"
    if language == "코리안": return "나는 파이썬 Python!"
    if language == "中國": return "我愛Python的 !"
    if language == "日本の": return "私はPythonのが大好き !"
    if language == "हिन्दी": return "मैं अजगर प्यार!"
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WuKongSecurity@BOB

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值