Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

py list 3d

import pprint    # importing pretty printed
  
def ThreeD(a, b, c):
    lst = [[ ['#' for values in range(a)] for col in range(b)] for row in range(c)]
    return lst
      
values= 5
col = 3
row = 2
# used the pretty printed function
pprint.pprint(ThreeD(values, col, row))

""" OUTPUT
[[['#', '#', '#', '#', '#'],
  ['#', '#', '#', '#', '#'],
  ['#', '#', '#', '#', '#']],
 [['#', '#', '#', '#', '#'],
  ['#', '#', '#', '#', '#'],
  ['#', '#', '#', '#', '#']]]
  """
Comment

PREVIOUS NEXT
Code Example
Python :: any python type hint 
Python :: how to slice a set in python 
Python :: difference between local and global variable in python 
Python :: Python try with else clause 
Python :: python change version 
Python :: plotly ylog 
Python :: undef variable 
Python :: python slice last 2 items of list 
Python :: python cv2 unblur 
Python :: pytorch tensor argmax 
Python :: /n python 
Python :: numba for python 
Python :: python nearly equal 
Python :: get last save id django model 
Python :: get sum of column before a date python 
Python :: python boucle for 
Python :: py random.sample 
Python :: find daily aggregation in pandas 
Python :: django login required class based views 
Python :: objects and classes in python 
Python :: migrate database in django 
Python :: sort np list of string 
Python :: BST_Deleting 
Python :: python pip past 
Python :: how to skip number in while loop python 
Python :: change group box border color pyqt5 
Python :: filter function in python 
Python :: def create(self validated_data) 
Python :: 0x80370102 kali linux 
Python :: root mean squared error in machine learning formula 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =