Posts

Showing posts with the label MAT

#4u: Coding in Python {FACTORIZATION}

Image
e='pos' f='neg' g='zer' dick='small' def hcfh(a,b,c,d):     z=max(a,b,c,d)     la=[]     for j in range(z,0,-1):         if a%j==0:             if b%j==0:                 if c%j==0:                     if d%j==0:                         la.append(j)     t=max(la)     return(t)              def hcf(a,b):     z=max(a,b)     lst=[]     for i in range(z,0,-1):         if a%i==0 and b%i==0:             lst.append(i)             m=max(lst)     return(m) def mymod(x):     if x>0:return 'pos'     if x<0:return 'neg'     if x==0:return 'zer' def man(a,b,c,d): ...

#4r: Codding in Python {DAY FINDER}

Image
#Note: Logic for this code was from my Mental Ability classes in my coaching center. for j in range(1):     print('Only for 4-digit year')     date=int(input('Enter date: '))     month=str(input('Enter full name of month in CAPS ON: '))     year=int(input('Enter 4-digit year: '))     k=[]     if date<=31:         if month=='JANUARY' or month=='FEBRUARY' or month=='MARCH' or month=='APRIL' or month=='MAY' or month=='JUNE' or month=='JULY' or month=='AUGUST' or month=='SEPTEMBER' or month=='OCTOBER' or month=='NOVEMBER' or month=='DECEMBER':             aa=year             for i in range(0,aa+1,4):                 k.append(i)             for t in (k):                 if t%100==0 and t%400!=0:     ...