-2

I currently am making a list in python and I would like to find out how I can print a list without printing the brackets.

I have tried using different techniques on W3schools but they don't work.

Here's my code...

import os
import time
list1 = [input("First item: "), input("Second item: "), 
input("Third item: ")]
time.sleep(0.5)
if (os.system == 'nt'):
  os.system("cls")
else:
  os.system("clear")
print(list1)
  • `print(*your_list)` to spread the list elements as args to print. You can specify `sep` to change the separator. – Samwise Dec 13 '22 at 04:55

1 Answers1

0

If a= [1,2,3'], then try:

print(str(a).replace(']', "").replace('[', "")), whose output will be: 1, 2, 3

zurcam
  • 61
  • 5