A More Novice Solution to Question 7 #141
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As I am going through the exercises, I've been trying to solve some of the problems with the basic skills I have.
For Q-7 I have managed to find a solution using more basic code.
Hope it is of help to those learning.
'''
values = input('Please Enter Numbers separated by Comma: ')
l = list() #array list
sl = list() #sub list
i = 0 # i-dimensional counter
j = 0 # j-dimensional counter
d = (values.split(',')) # creating an input list
X = int(d[0])
Y = int(d[1])
while i < X : # creating X-1 arrays
while j < Y : # creating the Y-1 array
y = i * j
j = j + 1
sl.append(y) # creating the Y arrays
j = 0 # to reset the counter back to 0 on each iteration
#print(sl) # print check
i = i + 1
l.append(sl)
sl = list() # RESETING Y array LIST BACK TO 0
print(l)
'''