- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python program to create 3D list.
3D list means 3D array. In this program we create 3D array with integer elements.
Input: 3× 3 × 2 [[1,1,1],[2,2,2],[3,3,3]], [[4,4,4],[5,5,5],[6,6,6]]
Step 1: given the order of 3D list. Step 2: using for loop we create list and print data.
# Python program to created 3D list import pprint def print3D(i, j, k): lst = [[ ['*' for cc1 in range(i)] for cc2 in range(j)] for r in range(k)] return lst # Driver Code c1 = 3 c2 = 2 r = 2 # used the pretty printed function pprint.pprint(print3D(c1, c2, r))
[[['*', '*', '*'], ['*', '*', '*']], [['*', '*', '*'], ['*', '*', '*']]]
- Python – 3D Matrix to Coordinate List
- Python program to create a sorted merged list of two unsorted list
- Python Program – Create dictionary from the list
- Python program to create and display a doubly linked list
- Python program to create and display a Circular Linked List
- Program to create linked list to binary search tree in Python
- Python Program to Create a Linked List & Display the Elements in the List
- How to create a Box (3D) in JavaFX?
- How to create a Sphere (3D) in JavaFX?
- How to create a Cylinder (3D) in JavaFX?
- Python program to create a sorted merged list of two unsorted lists
- Python program to create a doubly linked list from a ternary tree
- Python program to Flatten Nested List to Tuple List
- Program to create a list with n elements from 1 to n in Python
- Saving a 3D-plot in a PDF 3D with Python