Python:取近似值四舍五入
取近似值
http://www.nowcoder.com/questionTerminal/3ab09737afb645cc82c35d56a5ce802a
Python:取近似值四舍五入
def ab(): a_str = str(input()) xiaoshu = a_str.split('.')[1] fir_xiao = list(xiaoshu)[0] if int(fir_xiao) <5: return int(a_str.split('.')[0]) else: return int(a_str.split('.')[0])+1 print(ab())