Skip to content

Instantly share code, notes, and snippets.

View morningstar620's full-sized avatar
🎯
Focusing

Raj mandal (Aryan) morningstar620

🎯
Focusing
View GitHub Profile
# edyoda code war 3rd question
def is_palindrome(n):
# Convert the number to a string
num_str = str(n)
# Check if the string is equal to its reverse
if num_str == num_str[::-1]:
return "Yes"
# edyoda code war 2nd
def isDigitSumPalindrome(N):
def get_digit_sum(number):
# Calculate the sum of digits of the number
digit_sum = 0
while number > 0:
digit_sum += number % 10
number //= 10
return digit_sum
# python code for edyoda code war 1st question
def sum(arr, n):
total_sum = 0
for i in range(n):
total_sum += arr[i]
return total_sum
# Example 1