Posts

Showing posts from July, 2019

#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:                     k.remove(t)             if aa in (k):                 mny={'JANUARY':1,                      'FEBRUARY':4,

#4q: Codding in Python {1-Player : HAND CRICKET}

Image
import random as r hits=[1,1,2,3,3,3,4,4,4,5,5,5,6,6,6,6]      toss=['HEADS','TAILS'] toss1=str(input('Enter HEADS or TAILS: ')) toss2=r.choice(toss) if toss1==toss2:     print('You won the toss!')     bb=input('BAT or BALL first: ')     if bb=='BAT':         print()         print()         print('You are batting first.')         wickets=int(input('Enter number of Wickets: '))                  wic=0         runs=[]         while wickets>wic:                                       run=sum(runs)             qwert=[run,'/',wic]             for tttt in (qwert):                 print(tttt,end="")             print()                                       for rr in range(100):                 rh=int(input('What to hit (1,2,3,4,5,6): '))                 if rh in (hits):                                              bh=r.choice(hits)                     print('You

#4p: Codding in Python {2-player:Tic Tak Toe}

Image
print('Player 1 will start first.') ply1=str(input('Enter name player 1: ')) ply2=str(input('Enter name player 2: ')) aq=ply1 bq=ply2 def game():          arow=['a1','a2','a3']     brow=['b1','b2','b3']     crow=['c1','c2','c3']     a='a1'     b='a2'     c='a3'     d='b1'     e='b2'     f='b3'     g='c1'     h='c2'     i='c3'     avai=[a,b,c,d,e,f,g,h,i]     total=[arow,brow,crow]     player1=[]     m=player1     player2=[]     n=player2     def matrix():         for anya in (total):             for avya in (anya):                 print(avya,' ',end='')             print()          matrix()      for main in range(5):         if main<5:             shit1=ply1,'Where to hit: '                          for ww in range(10):                 mark=str(inpu