I'm curious about how to print the list using nested.
here's the code
students = [["BSIT",["JOSHUA", "CRISA", "JAYMARK"]], ["BSCS",["BOBS", "CARLO", "GERALD"]]]
for i,j in students:
print (i,"\n-",j)
when I try to print it,
BSIT
- ['JOSHUA', 'CRISA', 'JAYMARK']
BSCS
- ['BOBS', 'CARLO', 'GERALD']
>
How can I print element inside the "BSIT" individually? Is there any wrong syntax?
j…‽print (i, "\n-", *j)or if you need each oe on its own line, something in the form ofprint (i,"\n-".join([""]+j))