#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http

제목저도 3번 다르게 풀어봤어요!2018-09-19 22:14
작성자

연산자~~




1
2
3
4
5
6
7
8
9
10
11
12
13
def my_round(f):
    """ (float) -> int
    Return the Number rounded to the first decimal place from the given real number.
    >>> my_round(3.55)
    4
    """ 
    result = int((f-int(f)) > 0.5+ int(f)
    return result
 
print(my_round(3.14))
print(my_round(3.55))
cs
댓글
이전퀴즈3번2018-09-19
다음Boolean 수업 질문 내용 ( 3 < 5 != True )2018-09-19