Join() function

lis=["sarah","jossie","vivi","preeti","soundariya","rakul"]

for item in lis:
print(item,"and",end=" ")
print("other my gfs")

#this code result is same as upper code but in this we had used join function which make easy to code.

a=" and ".join(lis)
print(a,"other ex gfs")

Comments

Popular posts from this blog

Steps taken by a compiler to execute a C program

Tokens in C

Variables and Data Types in C