Answer the question
In order to leave comments, you need to log in
Error while outputting multiplication table?
I'm ashamed to ask such a stupid question, but I can't figure out how to solve this problem. I'm trying to display the multiplication table using for loops. Here is the code
a, b = 1, 5
x, y = 1, 5
for i in range(x, y):
# выводит верхнюю последовательность чисел
print("\t", i, end="")
for j in range(a, b):
# выводит боковую последовательность чисел
print()
for i in range(x, y):
# последовательности перемножаются
z = i * j
print(j, z, sep="\t", end="")
# print("\t", z, end="")
print(j, z, sep="\t", end="")
Answer the question
In order to leave comments, you need to log in
for i in range(1, 5):
# выводит верхнюю последовательность чисел
print("\t", i, end="")
for j in range(1, 5):
# выводит боковую последовательность чисел
print()
F = True
for i in range(1, 5):
# последовательности перемножаются
z = i * j
if F:print(j, end="")
print("\t", z, end="")
F = False
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question