PYTHON round

PYTHON round

题目
PYTHON round
For
this problem,we'll round an int value up to the next multiple of 10 if
its rightmost digit is 5 or more,so 15 rounds up to 20.Alternately,
round down to the previous multiple of 10 if its rightmost digit is less
than 5,so 12 rounds down to 10.Given 3 ints,a b c,return the sum of
their rounded values.To avoid code repetition,write a separate helper
"def round10(num):" and call it 3 times.
Example Output:round_sum(16,17,18) → 60round_sum(12,13,14) → 30round_sum(6,4,4) → 10
答案
$ pythonPython 2.7.3 (default, Jan  2 2013, 16:53:07) [GCC 4.7.2] on linux2Type "help", "copyright", "cre...
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
热门考点

超级试练试题库

© 2017-2019 超级试练试题库,All Rights Reserved.