1. 문제 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. 피보나치 수열의 각 항은 앞서는 두 개의 항을 더함으로써 얻어집니다. 초항이 1, 그 다음 항이 2로 시작한다면 처음 10개의 항은 다음과 같습니..
1. 문제 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. 10 미만의 3 혹은 5의 배수를 모두 나열하면 3, 5, 6, 9이고, 이 배수들의 합은 23입니다. 1000 미만의 3 혹은 5의 배수들의 합을 구하세요. 2. 풀이 풀이라 할만한 게 있나 싶네요. 간단한 코드로 해결할 수 있습니다. sum = 0 for i in range(3, 1000): if i % 3 == 0 or i % 5 == 0: sum += i pr..
Life is too short, you need Python프로그래밍에 조금이라도 관심이 있는 사람이라면 삼척동자라도 Python이 핫하다는 사실을 알고 있을 겁니다. Python은 특유의 쉬운 난이도와 범용성으로 Google을 비롯한 세계적인 IT기업에서도 주목하고 있는 언어입니다. 1. Python이란 Python은 귀도 반 로섬(Guido Van Rossum)이 1991년 발표한 범용 프로그래밍 언어입니다. 위키피디아(https://en.wikipedia.org/wiki/Python_(programming_language))에 실려있는 귀도가 Python을 만든 이유가 압권이네요. ...In December 1989, I was looking for a "hobby" programming proj..