Skip to content

Instantly share code, notes, and snippets.

View yuda110's full-sized avatar
👩‍💻
work work work

Dahyun Yu yuda110

👩‍💻
work work work
View GitHub Profile
#python3
result = 0
i = 1
while i < 1000 :
if i % 3 == 0 or i % 5 == 0:
result += i
i += 1
print(result)
#python3
num1 = 0
num2 = 1
num3 = num1 + num2
result = 0
while num3 <= 4000000 :
num3 = num1 + num2
num1 = num2
num2 = num3
#python3
def prime_factor(target) :
last_prime = 0
i = 2
while target != 1 :
while target % i == 0 :
last_prime = i
target //= i
i += 1
#python3
palindrome = []
def get_palindrome(num1, num2) :
max_palindrome = 0
num2_org = num2
while num1 > (num1/10) :
while num2 > (num2/10) :
multipled_num = num1*num2
if is_palindrome(multipled_num) and (max_palindrome < multipled_num):
#python3
def is_devidable(num_todo, num_to_devide):
return num_todo % num_to_devide == 0
def is_devidable_at_range(num_todo,range_from, range_to ):
result = True
for i in range(range_from, range_to):
if not is_devidable(num_todo, i):
result = False
break
#python3
def sum_square(range_from, range_to) :
sum_square = 0
for i in range(range_from, range_to) :
sum_square += i**2
return sum_square
def square_sum(range_from, range_to) :
sum = 0
for i in range(range_from, range_to) :
#python3
def is_prime_num(num) :
for i in range(2, int(num**0.5) + 1):
if num % i==0:
return False
return True
def find_prime_num(seq_range_to) :
num = 3
prime_seq = 1
#python3
def multiple_five_num(five_num) :
multiple = 1
for i in range(0, 5) :
multiple = multiple * int(five_num[i])
return multiple
def pickup_multiple_five_num(num) :
range_to = len(num)
max_num = 0
def find_pita():
for a in range(1, 1000):
for b in range(a+1, 1000):
c = 1000 - a - b
if a*a + b*b == c*c and a < b < c:
return a*b*c
#python3
def is_prime_num(num) :
for i in range(2, int(num**0.5) + 1):
if num % i==0:
return False
return True
def sum_prime_nums(range_to) :
prime_sum = 2+3+5+7
for num in range(7, range_to+1) :