• Feb 23, 2025 •hasnaoui1
0 likes • 7 views
print("hello world")
• Feb 26, 2023 •wabdelh
0 likes • 0 views
#You are given a two-digit integer n. Return the sum of its digits. #Example #For n = 29 the output should be solution (n) = 11 def solution(n): return (n//10 + n%10)
• Nov 19, 2022 •CodeCatch
0 likes • 1 view
def byte_size(s): return len(s.encode('utf-8')) byte_size('😀') # 4 byte_size('Hello World') # 11
0 likes • 4 views
from collections import Counter def find_parity_outliers(nums): return [ x for x in nums if x % 2 != Counter([n % 2 for n in nums]).most_common()[0][0] ] find_parity_outliers([1, 2, 3, 4, 6]) # [1, 3]
0 likes • 2 views
from math import pi def rads_to_degrees(rad): return (rad * 180.0) / pi rads_to_degrees(pi / 2) # 90.0
• Aug 1, 2025 •AustinLeath
from typing import Optional from datetime import datetime def convert_timestamp_string_to_epoch(timestamp: str) -> Optional[int]: epoch_time = None time_obj = datetime.strptime(timestamp, "%Y-%m-%d %H:%M:%S.%f") epoch_time = int((time_obj - datetime(1970, 1, 1)).total_seconds() * 1000) return epoch_time print(int(convert_timestamp_string_to_epoch("2025-08-01 13:11:47.171"))) #above outputs 1754053907171.0 #how to I remove the .0 ?