-1
f = open("dict.txt","a")
f.write("Customer_Name: "+Name+"\nMovies: "+Movies_Name+"\nQuantity: "+str(quantity)+"\n")
f.close()

Movies_Name is a list which might contain more than one movies. Now I want to write the names of the movies individually instead of writing them as a list.

1 Answers1

0

For me it has nothing to do with discord itself. It is just Python question. So answer can be found here

By using ''.join

list1 = ['1', '2', '3']
str1 = ''.join(list1)

In your case:

f.write("Customer_Name: "+Name+"\nMovies: "+''.join(Movies_Name)+"\nQuantity: "+str(quantity)+"\n")
VSMent
  • 376
  • 4
  • 11