• Nov 19, 2022 •CodeCatch
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
• May 31, 2023 •CodeCatch
0 likes • 0 views
import calendar # Prompt user for year and month year = int(input("Enter the year: ")) month = int(input("Enter the month: ")) # Create a calendar object cal = calendar.monthcalendar(year, month) # Display the calendar print(calendar.month_name[month], year) print("Mon Tue Wed Thu Fri Sat Sun") for week in cal: for day in week: if day == 0: print(" ", end="") else: print(str(day).rjust(2), " ", end="") print()
• Jul 2, 2025 •AustinLeath
0 likes • 1 view
import calendar from datetime import datetime # Get the UTC timestamp a = calendar.timegm(datetime.utcnow().utctimetuple()) print(a)
• Oct 4, 2023 •AustinLeath
0 likes • 10 views
weigh = lambda a,b: sum(b)-sum(a) FindCoin = lambda A: 0 if (n := len(A)) == 1 else (m := n//3) * (w := 1 + weigh(A[:m], A[2*m:])) + FindCoin(A[m*w:m*(w+1)]) print(FindCoin([1,1,1,1,1,1,1,2,1]))
• Feb 26, 2023 •wabdelh
#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)
• Jun 1, 2023 •CodeCatch
0 likes • 3 views
bytes_data = b'Hello, World!' string_data = bytes_data.decode('utf-8') print("String:", string_data)