Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create two variables x and y ( User will input these numbers ) . The maximum number for x and y is 5 , i

Create two variables x and y (User will input these numbers).
The maximum number for x and y is 5, i.e. more than this we will print an error on the console. Similarly, 1 is the minimum.
x represents the number of lists
y represents the number of elements in each list
Create a nested list based on x and y, and fill with ZERO (0).
For example, sample output for x =3 and y =4: Enter Number of Lists (x) : 3
Enter Number of List Elements (y) : 4
The resulting List is : [[0,0,0,0],[0,0,0,0],[0,0,0,0]] Similarly, sample output for x=4, and y=2 should be: Enter Number of Lists (x) : 4
Enter Number of Lists Elements (y) : 2
The resulting List is : [[0,0],[0,0],[0,0],[0,0]]
Similarly,
Enter Number of Lists (4) : 4
Enter Number of List Elements (y) : 6
Error: Not allowed to create List(s) in this case
The resulting List is: []

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago