【Python CheckiO 题解】I Love Python!
生活随笔
收集整理的這篇文章主要介紹了
【Python CheckiO 题解】I Love Python!
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
CheckiO 是面向初學者和高級程序員的編碼游戲,使用 Python 和 JavaScript 解決棘手的挑戰(zhàn)和有趣的任務,從而提高你的編碼技能,本博客主要記錄自己用 Python 在闖關時的做題思路和實現(xiàn)代碼,同時也學習學習其他大神寫的代碼。
CheckiO 官網(wǎng):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!】:練習函數(shù)的調(diào)用,定義一個函數(shù),返回字符串“I Love Python!”
【鏈接】:https://py.checkio.org/mission/i-love-python/
【輸入】:Nothing
【輸出】:字符串
【范例】:
i_love_python() == "I love Python!"代碼實現(xiàn)
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-testingassert 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 "??? ???? ?????!"總結
以上是生活随笔為你收集整理的【Python CheckiO 题解】I Love Python!的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 消息称华为Mate 50系列以4G为主:
- 下一篇: java数据结构 - 单链表(腾讯面试题