I have the following program
#ask user number of lines to display
user_input = input("How many lines to display? ")
line_count = int(user_input)
#ask users how many numbers on each line
user_input = input("How many numbers on each line? ")
number_count = int(user_input)
i=0
for x in range(line_count ):
for y in range(number_count):
print(i, end=', ')
i+=1
print()
The output, for example if the line number is 5 and the numbers on each line is 3.
How many lines to display? 5
How many numbers on each line? 3
0, 1, 2,
3, 4, 5,
6, 7, 8,
9, 10, 11,
12, 13, 14,
My issue is the last number of each row is followed by a commma. for example
0, 1, 2,
However my desired output is a fullstop at the end of each line. for example
0, 1, 2.
How am I able to achieve my desired output?