Hi there :)
I am trying to add numbers in a line, and was looking for help.
I am trying to add numbers in a line, and was looking for help.
size = input("Enter number: ") size = int(size) step = 1 number = 1 ran = 1 while number < size: for x in range(ran, size + 1, step) print((str(ran)+"|"), x) number += 1 ran += 1 step += 1This is my code atm and here is the output:
Output:Enter number: 5
1| 1
2| 2
3| 3
4| 4
5| 5
What I want to do is to make 5 lines (or whatever number the user inputs) along each column, So that it will create a kind of multiplication table. Like so:Output:Enter number: 5
1| 1 2 3 4 5
2| 2 4 6 8 10
3| 3 6 9 12 15
4| 4 8 12 16 20
5| 5 10 15 20 25
Any ideas?