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 :: python manual elif 
Python :: python match case example 
Python :: python remove vowels from string 
Python :: Python Try Except Else Clause 
Python :: facebook python 
Python :: why python stops after plt.show() 
Python :: Import "sendgrid" could not be resolved django 
Python :: Connect to MySQL Using Connector Python C Extension 
Python :: python split space or tab 
Python :: pythonhashseed 
Python :: python string name out of mail 
Python :: column to list pyspark 
Python :: stack widgets in tkinter 
Python :: how to sort dataframe in python by length of groups 
Python :: inicio programacao python 
Python :: Anderson-Darling test in python 
Python :: iterate rows and columns dataframe 
Python :: unique file name in django 
Python :: Python Permutation without built-in function [itertools] for String 
Python :: python add column to a matrix 
Python :: django migrate 
Python :: how to interrupt a loop in python 
Python :: Binary search tree deleting 
Python :: input and print 
Python :: how to call a class from another class python? 
Python :: how to scan directory recursively python 
Python :: rgb to grayscale python 
Python :: separate each characters by commas into a single characters separated by commas 
Python :: odoo docker addons path 
Python :: Python use number twice without assignment 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =