How can i print a list without the brackets?

ProgrammingNewbie

This is a function that allows me to print my two lists, cursosArreglo and tareasArreglo, but when I print them they come out like this: [['qwert'], ['fisica']] Esta es la lista de tareas y sus prioridades:

[['zxcvb'], ['4'], ['nbvcx'], ['3'], ['tregd'], ['2'], ['bvxx'], ['3']]

how can i print both lists without the brackets?

def verTareas():
    print("")
    print("Saludos "+nombre+(" a continuacion puede ver su informacion"))
    print("")
    print("Esta es la lista de cursos asignados: ")
    print str(cursosArreglo)
    print("Esta es la lista de tareas y sus prioridades: ")
    print '\n'+str(tareasArreglo)
    print("")
    regresar()
michaelpri

Here's some code that works without any modules or anything.

for i in range(len(cursosArreglo)):
    cursosArreglo[i] = "".join(cursosArreglo[i])

print(", ".join(cursosArreglo))

You can also run this for tareasArreglo by substituting it in for cursosArreglo.

This first goes through your list of lists, then substitutes each spot in the list with a string version of it, by using str.join(), then str.join again to fully join the list.

This can also be compressed into one line.

strCursosArreglo = ", ".join("".join(i) for i in cursosArreglo)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Print List of Lists without brackets

From Dev

How can I print the same list twice without empty it?

From Dev

print list of tuples without brackets python

From Dev

How can I use round brackets without making a group?

From Dev

How can I print XPS without dialog?

From Dev

How can i print page without header?

From Dev

how to print a tuple of tuples without brackets

From Dev

How to print a dictionary with multiple values without brackets?

From Dev

How can I remove brackets from individual (multiple) elements in a list?

From Dev

How can I list and print files in a directory?

From Dev

How can I print my outcome as a list?

From Dev

How can I print a list in columns?

From Dev

How can i print a list of arrays in JAVA?

From Dev

How can I print my outcome as a list?

From Dev

How can I format a list to print?

From Dev

How can I print something if an item is in a list?

From Dev

How to print a list of tuples with no brackets in Python

From Dev

How to print a list of tuples with no brackets in Python

From Dev

print array without brackets

From Dev

Python print a list of strings horizontally without quotations or brackets

From Dev

how to write list into csv columns without brackets?

From Dev

How can I print [] without string in Python in YAML file

From Java

How can I print to Stderr in Go without using log

From Dev

How can I make the new python accept print without parentheses?

From Dev

How can I print a newline without flushing the buffer?

From Dev

How can I print to OneNote without splitting the document?

From Dev

How can I make the new python accept print without parentheses?

From Dev

How can I print [] without string in Python in YAML file

From Dev

How many pages can I continuously print without damaging the printer?

Related Related

  1. 1

    Print List of Lists without brackets

  2. 2

    How can I print the same list twice without empty it?

  3. 3

    print list of tuples without brackets python

  4. 4

    How can I use round brackets without making a group?

  5. 5

    How can I print XPS without dialog?

  6. 6

    How can i print page without header?

  7. 7

    how to print a tuple of tuples without brackets

  8. 8

    How to print a dictionary with multiple values without brackets?

  9. 9

    How can I remove brackets from individual (multiple) elements in a list?

  10. 10

    How can I list and print files in a directory?

  11. 11

    How can I print my outcome as a list?

  12. 12

    How can I print a list in columns?

  13. 13

    How can i print a list of arrays in JAVA?

  14. 14

    How can I print my outcome as a list?

  15. 15

    How can I format a list to print?

  16. 16

    How can I print something if an item is in a list?

  17. 17

    How to print a list of tuples with no brackets in Python

  18. 18

    How to print a list of tuples with no brackets in Python

  19. 19

    print array without brackets

  20. 20

    Python print a list of strings horizontally without quotations or brackets

  21. 21

    how to write list into csv columns without brackets?

  22. 22

    How can I print [] without string in Python in YAML file

  23. 23

    How can I print to Stderr in Go without using log

  24. 24

    How can I make the new python accept print without parentheses?

  25. 25

    How can I print a newline without flushing the buffer?

  26. 26

    How can I print to OneNote without splitting the document?

  27. 27

    How can I make the new python accept print without parentheses?

  28. 28

    How can I print [] without string in Python in YAML file

  29. 29

    How many pages can I continuously print without damaging the printer?

HotTag

Archive