Question: Question 3 Write a python script: That has a function like the range() method called myRange(), which takes one parameter (n) and returns a list
Question 3 Write a python script: That has a function like the range() method called myRange(), which takes one parameter (n) and returns a list of numbers from 0 to the n value. Use this function and a for loop to create a list of lists of these numbers. Then loop through each row of this table and fill in the empty entries with zeros. Print this table twice by each row first without zeros and then with. Example Inputs/Outputs: Enter number of column: 5 Without zeros:
[1] [1, 2] [1, 2, 3] [1, 2, 3, 4] [1, 2, 3, 4, 5] With zeros: [1, 0, 0, 0, 0] [1, 2, 0, 0, 0] [1, 2, 3, 0, 0] [1, 2, 3, 4, 0] [1, 2, 3, 4, 5]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
