Last active
December 30, 2016 05:30
-
-
Save shoark7/1faa0ce8dae84292f1620c788eaea0b4 to your computer and use it in GitHub Desktop.
Question by "도와주세요" in Kakao python chatting room.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_sum(): | |
| number = int(input('숫자를 입력해주세요 : ')) | |
| rt_value = 1 | |
| rt_string = '1' | |
| for i in range(2, number + 1): | |
| rt_value += 1 / i | |
| rt_string += ' + 1/{}'.format(i) | |
| rt_string += ' = {}'.format(rt_value) | |
| print(rt_string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment