题解 | #学生基本信息输入输出#
学生基本信息输入输出
http://www.nowcoder.com/practice/58b6a69b4bf943b49d2cd3c15770b9fd
all_data = input().split(';')
b = all_data[1].split(',')
scores = list(map(lambda x: round(eval(x) + 0.0001, 2), all_data[1].split(',')))
print('The each subject score of No. {} is {:.2f}, {:.2f}, {:.2f}.'.format(all_data[0], scores[0], scores[1], scores[2]))
round奇进偶舍
即在小数点后位数正好为5时,如后面无其他数,奇数进位,偶数收取,故加上0.0001区分

查看5道真题和解析