Write a Python function to create a multidimensional list (lists of lists) with zeros and print the output.


Topic: Write a Python function to create a multidimensional list (lists of lists) with zeros and print the output.

Solution

nums = []
for i in range(3):
    nums.append([])
    for j in range(2):
        nums[i].append(0)
print("Multidimensional list:")
print(nums)



List all Python Programs