EvilCode
类似于Codewars
游戏.你必须解决尽快编程任务.然而,不同于Codewars
,EvilCode
奖你一枚奖牌,这取决于你把解决任务的时间.
获得金牌,你的时间必须是(严格)不如对应勋章的时间.您可以在所有授予`“金”,"银"或"铜奖"奖章’,或’“无”'奖章.只有一个奖章(最好的实现)获得.
现在给你的任务,并对应于每个勋章时实现的时间.你的任务是返回颁发奖牌.
MM:SS每次在格式
HH给出.
[输入]``串userTime
用户实现的时间.
[输入]``串gold
相当于金牌的时间.
[输入]``串silver
对应银牌的时间.
[输入]``串bronze
对应铜牌的时间.
这是保证`金<银
def evil_code_medal(user_time, gold, silver, bronze):
#your code here
Test.describe("Basic tests")
Test.assert_equals(evil_code_medal("00:30:00","00:15:00","00:45:00",),"Silver")
Test.assert_equals(evil_code_medal("01:15:00","00:15:00","00:45:00",),"None")
Test.assert_equals(evil_code_medal("00:00:01","00:00:10","00:01:40",),"Gold")
Test.assert_equals(evil_code_medal("00:10:01","00:00:10","00:01:40",),"Bronze")
Test.assert_equals(evil_code_medal("00:00:01","00:00:02","00:00:03",),"Gold")
Test.assert_equals(evil_code_medal("90:00:01","60:00:02","70:00:03",),"None")
Test.assert_equals(evil_code_medal("03:15:00","03:15:00","03:15:01",),"Silver")
Test.assert_equals(evil_code_medal("99:59:58","99:59:57","99:59:58",),"Bronze")
.((,,,),"Gold")
Test.assert_equals(evil_code_medal("61:01:40","64:19:53","79:30:02","95:24:48"),"Gold")
点击查看答案
景越Python基础训练营QQ群
欢迎各位同学加群讨论,一起学习,共同成长!
本博客所有编程题目及答案均收集自互联网,主要用于供网友学习参考,如有侵犯你的权益请联系管理员及时删除,谢谢
题目收集至https://www.codewars.com/
https://www.codewars.com/kata/simple-fun-number-270-evil-code-medal