enumerate in python

technical talkiess
0

 enumerate:-

l1 = ['sugar','Fair and lovely','coconut','web','data']


# agar isme se apko khali odd number hi lane hai to

# b=1

# for i in l1:

#     if b % 2 is not 0:

#         print(f"The items of kirana is :-{i}")

#     b+=1


# apko itna saab karne ki need nahi hai aap khali emumerate function call kar sakte hai


for index,value in enumerate(l1):

    if index%2 == 1:

         print(f"The items of kirana is :-{value}")



__main ___ == __ name ___

def printharry(strings):

    return f"This content is given the string {strings}"


def add(a,b):

    return a+b+6



# iske andar ka code khali isi file me run hoga age ki kisi bhi file me run nahi hoga


if __name__ == '__main__':

    print(printharry("adasdasd"))

    print("Test")

    a = add(5,5)

    print(a)


Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)