Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 3 additions & 38 deletions leap-year.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
Umut çalışıyor...



# **Exercise | ?comprehension | ?range() | ?len() | ?nested for loop() | ?any() | ?sum() | ?append()**
# 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
# What is the smallest positive number which is evenly divisible by all of the numbers from 1 to 20?
# MClay
nums_prime = []

for i in nums :
prime = []
for j in range(2,i) :
prime.append(i % j != 0)
if all(prime) and i != 1 :
nums_prime += [i]
new_number = []
while True :
for i in nums_prime :
temp = []
for j in range(len(nums)) :
temp.append(nums[j] % i == 0)
if nums[j] % i == 0 :
nums[j] = nums[j] // i
if any(temp) :
new_number += [i]
if sum(nums) == 20 :
break
count = 1
for i in new_number :
count *= i
print(count)
# Default function to implement conditions to check leap year
def CheckLeap(year) :
# Checking if the given year is leap year


print("merhaba")

Umut çalışıyor...
int("merhaba")


x = 6
Expand Down