Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list in list python

l1 = [1,2,3]
l2 = [4,5,6]
l3 = [7,8,9]

lst = []

lst.append(l1)
lst.append(l2)
lst.append(l3)
print(lst)
Comment

List in list

List<List<Integer>> listOfLists = new ArrayList<>();
Comment

list in list

import java.util.*;

public class JavaHungry
{
    public static void main(String[] args)
    {
        // Create listOfLists in Java
        List<List<Integer>> listOfLists = new ArrayList<>();
        
        // Creating innerList 
        List<Integer> innerList = new ArrayList<>();
        
        // Adding elements to innerList
        innerList.add(1);
        innerList.add(2);
        innerList.add(3);
        
        // Adding innerList to listOfLists
        listOfLists.add(innerList);
        
        // Creating another inner list 
        List<Integer> innerList2 = new ArrayList<>();
        
        // Adding elements to innerList2
        innerList2.add(100);
        innerList2.add(101);
        innerList2.add(102);
        
        // Adding innerList2 to listOfLists
        listOfLists.add(innerList2);        

        // Printing listOfLists elements
        System.out.println(listOfLists);
    }
}
Comment

PREVIOUS NEXT
Code Example
Python :: prime number checking algorithm 
Python :: python convert object to json 
Python :: python squared math function 
Python :: enumarate in python 
Python :: pathlib path forward or back slahses 
Python :: HUNGRY CHEF codechef 
Python :: virtual environments for python 
Python :: lambda function in python 
Python :: disable gpu in jupyter notebook in tensorflow 
Python :: bokeh xlabel rotate 
Python :: turn columns into one column as list python 
Python :: discord.py clear status 
Python :: dropna pandas 
Python :: how to separate url from text in python 
Python :: seaborn distplot 
Python :: plot multiindex columns pandas 
Python :: how to change todays date formate in python 
Python :: python machine learning scale 
Python :: 2d arrays using python numpy 
Python :: py2exe no console 
Python :: filter foreign fileds django_filters 
Python :: python list to dict 
Python :: get file parent directory python 
Python :: postgresql backup using python 
Python :: pytest logcli to write to file 
Python :: List Delete a Element 
Python :: how to add subtitle to plot in python 
Python :: python prime number sum 
Python :: python sum 
Python :: what if discord.py python add-in does not work 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =