logo-MindMajix
PostPythonPython
c
chris bons

Posted on 21st July 2024|21 views

0
votes

Python Array To String

How to convert array to string in python?

1 answers
Answers
P
Harish Harsh

Posted on 21st July 2024| views

Let us see a program for converting an array to string

# Function that convert  

def listToString(s): 

#let us initialize an empty string first

   str = "" 

# next traverse within the string  

    for ele in s: 

        str += ele  

 # returning the string  

    return str 

 # Driver code  

s1 = [‘mind’,’majix’]

print(listToString(s1))

Output:

mindmajix

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number