Skip to content

Instantly share code, notes, and snippets.

@shoark7
Last active December 30, 2016 05:30
Show Gist options
  • Select an option

  • Save shoark7/1faa0ce8dae84292f1620c788eaea0b4 to your computer and use it in GitHub Desktop.

Select an option

Save shoark7/1faa0ce8dae84292f1620c788eaea0b4 to your computer and use it in GitHub Desktop.
Question by "도와주세요" in Kakao python chatting room.
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