print함수 %로 소숫점 표현 a=1.1564 b=58.4894 print("%.3f %.2f"%(a,b)) %.nf 로 소수점 n째자리까지 반올림하여 표현 프로그래밍 문법/python 2020.06.22
파이썬반올림 함수 round round(실수,n) : 실수를 반올림하여 소수점 n째자리 까지 나타낸 수 print(round(16.35,2)) print(round(16.35,1)) print(round(16.35,0)) print(round(16.35)) print(round(16.35,-1)) 더보기 16.35 16.4 16.0 16 20.0 프로그래밍 문법/python 2020.06.19