Support our Blind Hand Charity by donating at 9818291723. Your contribution has the potential to bring about significant positive change for humanity.

Search This Blog

Saturday, December 30, 2023

SNAKE N LADDERS

import random as ran
u=[' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ']
c=[' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ']
dice=["""┌───────┐\
│       │\
│   •   │\
│       │\
└───────┘""","""┌───────┐\
│ •     │\
│       │\
│     • │\
└───────┘""","""┌───────┐\
│ •     │\
│   •   │\
│     • │\
└───────┘""","""┌───────┐\
│ •   • │\
│       │\
│ •   • │\
└───────┘""","""┌───────┐\
│ •   • │\
│   •   │\
│ •   • │\
└───────┘""","""┌───────┐\
│ •   • │\
│ •   • │\
│ •   • │\
└───────┘"""]
sc=su=scc=scu=chc=chu=0
print('\tTOKEN COLOR')
print("USER -->",'•')
print("COMPUTER -->",'○')
def computer():
    global sc,rc,su,chc,chu
    if sc==0:
        if (rc==6):
            sc+=1
    else:
        sc+=rc
    if ((63>=sc>0) and (su<63)):
        if sc==2:
            sc=19
            print("COMPUTER CLIMBED THE STAIRS")
        elif sc==26:
            sc=8
            print("COMPUTER GOT A SNAKE BITE")
        elif sc==38:
            sc=53
            print("COMPUTER CLIMBED THE STAIRS")
        elif sc==61:
            sc=47
            print("COMPUTER GOT A SNAKE BITE")
    if su>63:
        su-=ru
def user():
    global sc,rc,su,chc,chu
    if su==0:
        if (ru==6):
            su+=1
    else:
        su+=ru
    if ((63>=su>0) and (sc<63)):
        if su==2:
            su=19
            print("USER CLIMBED THE STAIRS. NOW USER ROLL THE DICE AGAIN")
        elif su==26:
            su=8
            print("USER GOT A SNAKE BITE")
        elif su==38:
            su=53
            print("USER CLIMBED THE STAIRS. NOW USER ROLL THE DICE AGAIN")
        elif su==61:
            su=47
            print("USER GOT A SNAKE BITE")
    if su>63:
        su-=ru
while True:
    print("""[1].PLAY
[2].SCORECARD
[3].EXIT""")
    o=int(input("Enter option number = "))
    if o==3:
        break
    elif o==1:
        while True:
            q=input("roll the dice? y/n or e to exit = ")
            if q.lower()=='e':
                break
            elif q.lower()=='y':
                rc=ran.randint(1,6)
                ru=ran.randint(1,6)
                dc=dice[rc-1]
                du=dice[ru-1]
                s=0
                print(' User\tComputer')
                for i in range(0,5):
                    print(du[s:s+9]+dc[s:s+9])
                    s+=9
                user()
                computer()
                for i in range(0,len(u)):
                    if i==su:
                        u[su]='•'
                    else:
                        u[i]=' '
                for i in range(0,len(c)):
                    if i==sc:
                        c[sc]='○'
                    else:
                        c[i]=' '
            print('┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐',sep='')
            print('│  ',u[63],c[63],'  │  ',u[62],c[62],'  │  S2M │  ',u[60],c[60],'  │  ',u[59],c[59],'  │  ',u[58],c[58],'  │  ',u[57],c[57],'  │  ',u[56],c[56],'  │',sep='')
            print('│  64  │  63  │  62  │  61  │  60  │  59  │  58  │  57  │',sep='')
            print('├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤',sep='')
            print('│  ',u[48],c[48],'  │  ',u[49],c[49],'  │  ',u[50],c[50],'  │  ',u[51],c[51],'  │  ',u[52],c[52],'  │L2E',u[53],c[53],' │  ',u[54],c[54],'  │  ',u[55],c[55],'  │',sep='')
            print('│  49  │  50  │  51  │  52  │  53  │  54  │  55  │  56  │',sep='')
            print('├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤',sep='')
            print('│S2T',u[47],c[47],' │  ',u[46],c[46],'  │  ',u[45],c[45],'  │  ',u[44],c[44],'  │  ',u[43],c[43],'  │  ',u[42],c[42],'  │  ',u[41],c[41],'  │  ',u[40],c[40],'  │',sep='')
            print('│  48  │  47  │  46  │  45  │  44  │  43  │  42  │  41  │',sep='')
            print('├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤',sep='')
            print('│  ',u[32],c[32],'  │  ',u[33],c[33],'  │  ',u[34],c[34],'  │  ',u[35],c[35],'  │  ',u[36],c[36],'  │  ',u[37],c[37],'  │  L2B │  ',u[39],c[39],'  │',sep='')
            print('│  33  │  34  │  35  │  36  │  37  │  38  │  39  │  40  │',sep='')
            print('├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤',sep='')
            print('│  ',u[31],c[31],'  │  ',u[30],c[30],'  │  ',u[29],c[29],'  │  ',u[28],c[28],'  │  ',u[27],c[27],'  │  S1M │  ',u[25],c[25],'  │  ',u[24],c[24],'  │',sep='')
            print('│  32  │  31  │  30  │  29  │  28  │  27  │  26  │  25  │',sep='')
            print('├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤',sep='')
            print('│  ',u[16],c[16],'  │  ',u[17],c[17],'  │  ',u[18],c[18],'  │L1E',u[19],c[19],' │  ',u[20],c[20],'  │  ',u[21],c[21],'  │  ',u[22],c[22],'  │  ',u[23],c[23],'  │',sep='')
            print('│  17  │  18  │  19  │  20  │  21  │  22  │  23  │  24  │',sep='')
            print('├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤',sep='')
            print('│  ',u[15],c[15],'  │  ',u[14],c[14],'  │  ',u[13],c[13],'  │  ',u[12],c[12],'  │  ',u[11],c[11],'  │  ',u[10],c[10],'  │  ',u[9],c[9],'  │S1E',u[8],c[8],' │',sep='')
            print('│  16  │  15  │  14  │  13  │  12  │  11  │  10  │  09  │',sep='')
            print('├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤',sep='')
            print('│  ',u[0],c[0],'  │  ',u[1],c[1],'  │  L1B │  ',u[3],c[3],'  │  ',u[4],c[4],'  │  ',u[5],c[5],'  │  ',u[6],c[6],'  │  ',u[7],c[7],'  │',sep='')
            print('│START │  02  │  03  │  04  │  05  │  06  │  07  │  08  │',sep='')
            print('└──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘',sep='')
            if sc==63 and su==63:
                print("TIE")
                break
            elif sc==63:
                print("YOU LOSE")
                scc+=1
                break
            elif su==63:
                print("YOU WON")
                scu+=1
                break
    elif o==2:
        print("\tWINS")
        print("USER ---->",scu)
        print("COMPUTER ---->",scc)

OUTPUT












Monday, December 18, 2023

ODD AND EVEN GAME

import random as ran

gs=gc=gscw=gsuw=gccw=gcuw=0
o=0
while o!=3:
    print("""Choose the game mode:
[1]. Simple
[2]. Crazy
[3]. Exit""")
    o=int(input("Enter the mode number = "))
    if o==3:
        break
    if o==1 or o==2:
        print("Choose: [1].Even or [2].Odd")
        d=int(input("Enter the decision number = "))
        r=ran.randint(1,10)
        cpt=0
        while cpt!=1:
            ou=int(input("Enter your number = "))
            if ou<11:
                cpt=1
            else:
                print("Incorrect number Entered")
        if d==1:
            print("User\tComputer")
            print("Even\t  Odd  ")
            print('┌───┐\t ┌───┐')
            print(' ',ou,' \t  ',r,' ')
            print('└───┘\t └───┘')
            bu=bc=0
            if (ou+r)%2==0:
                print("You won the toss. Choose [1].Ball or [2].Bat")
                bu=int(input("Enter your decison number = "))
                bc=3-bu
            else:
                print("You Loss the toss")
                bc=ran.randint(1,2)
                bu=3-bc
                if bc==1:
                    print("I choose To ball")
                elif bc==2:
                    print("I choose to Bat")
        elif d==2:
            print("User\tComputer")
            print(" Odd\t  Even ")
            print('┌───┐\t ┌───┐')
            print(' ',ou,' \t  ',r,' ')
            print('└───┘\t └───┘')
            bu=bc=0
            if (ou+r)%2!=0:
                print("You won the toss. Choose [1].Ball or [2].Bat")
                bu=int(input("Enter your decison number = "))
                bc=3-bu
            else:
                print("You Loss the toss")
                bc=ran.randint(1,2)
                bu=3-bc
                if bc==1:
                    print("I choose To ball")
                elif bc==2:
                    print("I choose to Bat")
    if o==1:
        gs+=1
        if bu==2:
            su=pu=0
            print("User Batting Begins")
            while pu!=-1:
                cc=ran.randint(1,10)
                cpt=0
                while cpt!=1:
                    cu=int(input("Enter your number = "))
                    if 0<cu<11:
                        cpt=1
                    else:
                        print("Incorrect number Entered")
                print("User\tComputer")
                print(" Bat\t  Ball  ")
                print('┌───┐\t ┌───┐')
                print(' ',cu,' \t  ',cc,' ')
                print('└───┘\t └───┘')
                if cc==cu:
                    print("You scored",su,'run')
                    su+=1
                    print("Target :",su)
                    pu=-1
                else:
                    su+=cu
                    print('Runs Scored -',su)
            sc=pc=0
            print("Computer Batting Begins")
            while pc!=-1:
                cc=ran.randint(1,10)
                cpt=0
                while cpt!=1:
                    cu=int(input("Enter your number = "))
                    if 0<cu<11:
                        cpt=1
                    else:
                        print("Incorrect number Entered")
                print("User\tComputer")
                print("Ball\t  Bat  ")
                print('┌───┐\t ┌───┐')
                print(' ',cu,' \t  ',cc,' ')
                print('└───┘\t └───┘')
                print('Target -',su)
                if cc==cu:
                    print("You won by",su-sc,'runs')
                    pc=-1
                    gsuw+=1
                elif (sc+cc)>=su:
                    print("Computer Won")
                    pc=-1
                    gscw+=1
                else:
                    sc+=cc
                    print('Runs Scored -',sc)
        if bc==2:
            print("Computer Batting Begins")
            sc=pc=0
            while pc!=-1:
                cc=ran.randint(1,10)
                cpt=0
                while cpt!=1:
                    cu=int(input("Enter your number = "))
                    if 0<cu<11:
                        cpt=1
                    else:
                        print("Incorrect number Entered")
                print("User\tComputer")
                print("Ball\t  Bat  ")
                print('┌───┐\t ┌───┐')
                print(' ',cu,' \t  ',cc,' ')
                print('└───┘\t └───┘')
                if cc==cu:
                    print("Computer scored",sc,'run')
                    sc+=1
                    print("Target :",sc)
                    pc=-1
                else:
                    sc+=cc
                    print('Runs Scored -',sc)
            su=pu=0
            print("User Batting Begins")
            while pu!=-1:
                cc=ran.randint(1,10)
                cpt=0
                while cpt!=1:
                    cu=int(input("Enter your number = "))
                    if 0<cu<11:
                        cpt=1
                    else:
                        print("Incorrect number Entered")
                print("User\tComputer")
                print(" Bat\t  Ball  ")
                print('┌───┐\t ┌───┐')
                print(' ',cu,' \t  ',cc,' ')
                print('└───┘\t └───┘')
                print('Target -',sc)
                if cc==cu:
                    print("Computer won by",sc-su,'runs')
                    pu=-1
                    gscw+=1
                elif (su+cu)>=sc:
                    print("User Won")
                    pu=-1
                    gsuw+=1
                else:
                    su+=cu
                    print('Runs Scored -',su)
    if o==2:
        gc+=1
        if bu==2:
            print("User Batting Begins")
            su=pu=0
            while pu!=-1:
                cc=ran.randint(1,10)
                cpt=0
                while cpt!=1:
                    cu=int(input("Enter your number = "))
                    if 0<cu<11:
                        cpt=1
                    else:
                        print("Incorrect number Entered")
                print("User\tComputer")
                print(" Bat\t  Ball  ")
                print('┌───┐\t ┌───┐')
                print(' ',cu,' \t  ',cc,' ')
                print('└───┘\t └───┘')
                cr==0
                if cc==cu:
                    su+=cc*cu
                    cr=1
                    print('Runs Scored -',su)
                if (cu==cc-1) or (cu==cc+1):
                    print("You scored",su,'run')
                    su+=1
                    print("Target :",su)
                    pu=-1
                    break
                if cr==0:
                    su+=cu
                    print('Runs Scored -',su)
            sc=pc=0
            print("Computer Batting Begins")
            while pc!=-1:
                cc=ran.randint(1,10)
                cpt=0
                while cpt!=1:
                    cu=int(input("Enter your number = "))
                    if 0<cu<11:
                        cpt=1
                    else:
                        print("Incorrect number Entered")
                print("User\tComputer")
                print("Ball\t  Bat  ")
                print('┌───┐\t ┌───┐')
                print(' ',cu,' \t  ',cc,' ')
                print('└───┘\t └───┘')
                print('Target -',su)
                cr=0
                if cc==cu:
                    sc+=cc*cu
                    cr=1
                    print('Runs Scored -',sc)
                if (cc==cu-1) or (cc==cu+1):
                    print("You won by",su-sc,'runs')
                    pc=-1
                    gcuw+=1
                    break
                if sc>=su:
                    print("Computer Won")
                    gccw+=1
                    pc=-1
                    break
                if cr==0:
                    sc+=cc
                    print('Runs Scored -',sc)
        if bc==2:
            sc=pc=0
            print("Computer Batting Begins")
            while pc!=-1:
                cc=ran.randint(1,10)
                cpt=0
                while cpt!=1:
                    cu=int(input("Enter your number = "))
                    if 0<cu<11:
                        cpt=1
                    else:
                        print("Incorrect number Entered")
                cc=cu=0
                print("User\tComputer")
                print("Ball\t  Bat  ")
                print('┌───┐\t ┌───┐')
                print(' ',cu,' \t  ',cc,' ')
                print('└───┘\t └───┘')
                cr=0
                if cc==cu:
                    sc+=cc*cu
                    cr=1
                    print('Runs Scored -',sc)
                if (cc==cu-1) or (cc==cu+1):
                    print("Computer scored",sc,'run')
                    sc+=1
                    print("Target :",sc)
                    pc=-1
                    break
                if cr==0:
                    sc+=cc
                    print('Runs Scored -',sc)
            su=pu=0
            print("User Batting Begins")
            while pu!=-1:
                cc=ran.randint(1,10)
                cpt=0
                while cpt!=1:
                    cu=int(input("Enter your number = "))
                    if 0<cu<11:
                        cpt=1
                    else:
                        print("Incorrect number Entered")
                print("User\tComputer")
                print(" Bat\t  Ball  ")
                print('┌───┐\t ┌───┐')
                print(' ',cu,' \t   ',cc,' ')
                print('└───┘\t └───┘')
                print('Target -',sc)
                cr=0
                if cc==cu:
                    su+=cc*cu
                    cr=1
                    print('Runs Scored -',su)
                if (cu==cc-1) or (cu==cc+1):
                    print("Computer won by",sc-su,'runs')
                    pu=-1
                if su>=sc:
                    print("User Won")
                    pu=-1
                    break
                if cr==0:
                    su+=cu
                    print('Runs Scored -',su)
    print("\n\tSIMPLE")
    print("User -",gsuw)
    print("Computer -",gscw)
    print("\n\tCRAZY")
    print("User -",gcuw)
    print("Computer -",gccw,'\n')

OUTPUT







Saturday, December 16, 2023

RANDOM DIGIT WELL

import random as ran

l=[0,0,0,0,0,0,0,0,0]

c=3

acl=[0,0,0,0,0,0,0,0,0]

o=0

c=0

while o!=3:

    print("""Choose the operation to perform:

1. Clockwise

2. Anti Clockwise

3. Exit""")

    o=int(input("Enter the operation number = "))

    if o==3:

        break

    elif o==1:

        c+=1

        m=[0,0,0,0,0,0,0,0,0]

        for i in range(2,-5,-1):

            m[i]=l[i+1]

        if l[5]!=0:

            ac=[0,0,0,0,0,0,0,0,0]

            for i in range(0,8):

                ac[i+1]=acl[i]

            for i in range(0,9):

                acl[i]=ac[i]

            acl[0]=l[5]

        for i in range(0,9):

            l[i]=m[i]

        r=ran.randint(1,9)

        l[3]=r

    elif o==2:

        m=[0,0,0,0,0,0,0,0,0]

        for i in range(-5,3):

            m[i+1]=l[i]

        for i in range(0,9):

            l[i]=m[i]

        if acl[0]!=0:

            l[5]=acl[0]

        ac=[0,0,0,0,0,0,0,0,0]

        for i in range(0,8):

            ac[i]=acl[i+1]

        for i in range(0,9):

            acl[i]=ac[i]

    s=0

    for i in range(0,9):

        if l[i]==0:

            s+=1

    if s==9:

        print("WELL IS EMPTY")

    print(l[2],'│',l[1],'│',l[0])

    print('──┼───┼──')

    print(l[3],'│',l[4],'│',l[8])

    print('──┼───┼──')

    print(l[5],'│',l[6],'│',l[7])

    print('  │   │  ')

OUTPUT








Thursday, December 14, 2023

ELEDEX

e=int(input("Enter number of protons = "))

en=e

ep=e

csh=0

ece=['1s','2s','2p','3s','3p','4s','3d','4p','5s','4d','5p','6s','4d','5p','6s','4f','5d','6p','7s','5f','6d','7p']

s=0

c=0

m=0

eceo=[]

ecep=[]

eces=[]

gr=0

num=[0,'¹','²','³','⁴','⁵','⁶','⁷','⁸','⁹','¹⁰','¹¹','¹²','¹³','¹⁴']

sup=['¹⁴','¹³','¹²','¹¹','¹⁰','⁹','⁸','⁷','⁶','⁵','⁴','³','²','¹']

if e==24:

    c=1

    ecep.append('1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d⁵')

    print(""" Electronic configuration(Shell wise) = 2,8,8,6

Electronic configuration(Subshell wise) = 1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d⁵

Electronic Configuration(Noble Gas Wise) = [Ar]4s¹,3d⁵

Atomic Number = 24

Number of Electrons = 24

Number of Protons = 24

Oxidation State = 1,2,3,4,5,6

Period = 4

group = 6""")

elif e==29:

    c=1

    ecep.append('1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d¹⁰')

    print("""Electronic Configuration(Shell wise) = 2,8,8,8,3

Electronic Configuration(Subshell wise) = 1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d¹⁰

Electronic Configuration(Noble Gas Wise) = [Ar]4s¹,3d¹⁰

Position in period Table = Period-4,Group-11

Atomic Number = 29

Number of Electrons = 29

Number of Protons = 29

Oxidation State = 1,2,3

Period = 4

Group=11""")

if c!=1:

    print("Electronic Configuration(Shell wise) = ",end="")

    while en>0:

        csh+=1

        if csh==1:

            en=en-2

            if en>=0:

                eces.append(2)

            elif en<0:

                eces.append(1)

        else:

            en=en-8

            if en>=0:

                eces.append(8)

            elif en<0:

                eces.append(8+en)

    

    for i in range(0,len(eces)):

        if i==len(eces)-1:

            print(eces[i])

        else:

            print(eces[i],end=",")

    

    print("Electronic Configuration(Subshell wise) = ",end="")

    while e>0:

        if ece[s][1]=='s':

            e=e-2

            if e>=0:

                ecep.append(ece[s])

                ecep.append(sup[-2])

            elif e<0:

                ecep.append(ece[s])

                ecep.append(sup[-1])

            s+=1

        elif ece[s][1]=='p':

            e=e-6

            if e>=0:

                ecep.append(ece[s])

                ecep.append(sup[-6])

            elif e<0:

                ecep.append(ece[s])

                ecep.append(sup[-(6-abs(e))])

            s+=1

        elif ece[s][1]=='d':

            e=e-10

            if e>=0:

                ecep.append(ece[s])

                ecep.append(sup[-10])

            elif e<0:

                ecep.append(ece[s])

                ecep.append(sup[-(10-abs(e))])

            s+=1

        elif ece[s][1]=='f':

            e=e-14

            if e>=0:

                ecep.append(ece[s])

                ecep.append(sup[0])

            elif e<0:

                ecep.append(ece[s])

                ecep.append(sup[-(14-abs(e))])

            s+=1


    for i in range(0,len(ecep)):

        if i==len(ecep)-1:

            print(ecep[i],end='')

        elif i%2!=0:

            print(ecep[i],sep='',end=',')

        else:

            print(ecep[i],end='')

    

    if ecep[len(ecep)-2]=='s':

        g=sup.index(ecep[len(ecep)-1])

    print()

    for i in range(0,len(ecep)):

        m+=1

        if 9>=ep>1:

            if m==1:

                print("Electronic Configuration(Noble gas wise) =",'[He]',end="")

            if i>1:

                print(ecep[i],end="")

        elif 17>=ep>9:

            if m==1:

                print("Electronic Configuration(Noble gas wise) =",'[Ne]',end="")

            if i>5:

                print(ecep[i],end="")

        elif 35>=ep>17:

            if m==1:

                print("Electronic Configuration(Noble gas wise) =",'[Ar]',end="")

            if i>9:

                print(ecep[i],end="")

        elif 53>=ep>35:

            if m==1:

                print("Electronic Configuration(Noble gas wise) =",'[Kr]',end="")

            if i>15:

                print(ecep[i],end="")

        elif 85>=ep>53:

            if m==1:

                print("Electronic Configuration(Noble gas wise) =",'[Xe]',end="")

            if i>21:

                print(ecep[i],end="")

        elif 117>=ep>85:

            if m==1:

                print("Electronic Configuration(Noble gas wise) =",'[Rn]',end="")

            if i>31:

                print(ecep[i],end="")

        elif 127>=ep>117:

            if m==1:

                print("Electronic Configuration(Noble gas wise) =",'[Og]',end="")

            if i>39:

                print(ecep[i],end="")

    print()

    print("Atomic Number =",ep)

    print("Number of Electrons =",ep)

    print("Number of Protons =",ep)

    if len(eces)>3:

        print("Oxidation = ",end="")

        for i in range(1,eces[len(eces)-1]+1):

            if i==eces[len(eces)-1]:

                print(i,end="")

            else:

                print(i,end=",")

    else:

        if eces[len(eces)-1]<=4:

            print("Oxidation State =",eces[len(eces)-1])

        else:

            print("Oxidation State =",8-eces[len(eces)-1])

    for i in range(0,len(ecep)):

        eceo.append(ecep[i])

    grp=ecep[len(ecep)-3::1]

    sr=[]

    for i in range(0,len(ecep)):

        if ecep[i][0].isdigit():

            sr.append(ecep[i])

    sr.sort()

    print()

    j=-1

    for i in range(0,len(grp)):

        for j in range(0,len(grp[i])):

            if grp[i][j]=='s':

                gr=num.index(grp[-1])

            elif grp[i][j]=='p':

                gr=num.index(grp[-1])+10+num.index(grp[-3])

            elif grp[i][j]=='d':

                gr=num.index(grp[-1])+num.index(grp[-3])

    print("Group =",gr)

    print("Period =",grp[1][0])

OUTPUT