• Oct 7, 2022 •KETRICK
0 likes • 1 view
import pandas as pd x = pd.read_excel(FILE_NAME) print(x)
• Nov 19, 2022 •CodeCatch
0 likes • 7 views
def when(predicate, when_true): return lambda x: when_true(x) if predicate(x) else x double_even_numbers = when(lambda x: x % 2 == 0, lambda x : x * 2) print(double_even_numbers(2)) # 4 print(double_even_numbers(1)) # 1
• Jul 8, 2025 •AustinLeath
0 likes • 5 views
from datetime import datetime epoch_time = 1753823646 # Example epoch time (March 15, 2023 00:00:00 UTC) # Convert epoch time to a UTC datetime object utc_datetime = datetime.utcfromtimestamp(epoch_time) print(f"Epoch time: {epoch_time}") print(f"UTC datetime: {utc_datetime}") # You can also format the output string formatted_utc_time = utc_datetime.strftime('%m-%d-%Y %H:%M:%S UTC') print(f"Formatted UTC datetime: {formatted_utc_time}")
0 likes • 0 views
# Python program for implementation of Selection # Sort import sys A = [64, 25, 12, 22, 11] # Traverse through all array elements for i in range(len(A)): # Find the minimum element in remaining # unsorted array min_idx = i for j in range(i+1, len(A)): if A[min_idx] > A[j]: min_idx = j # Swap the found minimum element with # the first element A[i], A[min_idx] = A[min_idx], A[i] # Driver code to test above print ("Sorted array") for i in range(len(A)): print("%d" %A[i]),
• Nov 18, 2022 •AustinLeath
0 likes • 14 views
# question3.py from itertools import product V='∀' E='∃' def tt(f,n) : xss=product((0,1),repeat=n) print('function:',f.__name__) for xs in xss : print(*xs,':',int(f(*xs))) print('') # this is the logic for part A (p\/q\/r) /\ (p\/q\/~r) /\ (p\/~q\/r) /\ (p\/~q\/~r) /\ (~p\/q\/r) /\ (~p\/q\/~r) /\ (~p\/~q\/r) /\ (~p\/~q\/~r) def parta(p,q,r) : a=(p or q or r) and (p or q or not r) and (p or not q or r)and (p or not q or not r) b=(not p or q or r ) and (not p or q or not r) and (not p or not q or r) and (not p or not q or not r) c= a and b return c def partb(p,q,r) : a=(p or q and r) and (p or not q or not r) and (p or not q or not r)and (p or q or not r) b=(not p or q or r ) and (not p or q or not r) and (not p or not q or r) and (not p or not q or not r) c= a and b return c print("part A:") tt(parta,3) print("part B:") tt(partb,3)
• Sep 14, 2024 •rgannedo-6205
0 likes • 2 views
https://codecatch.net/post/06c9f5b7-1e00-40dc-b436-b8cccc4b69be