This Python program reads two integers x and y from the user.
It then calculates and displays the multiplication results of y with numbers from 1 to x.
x = int(input("Enter x: "))
y = int(input("Enter y: "))
print(f"\nMultiplication table of {y} up to {x}:")
for i in range(1, x + 1):
result = i * y
print(f"{i} × {y} = {result}")
Enter x: 5
Enter y: 3
Multiplication table of 3 up to 5:
1 × 3 = 3
2 × 3 = 6
3 × 3 = 9
4 × 3 = 12
5 × 3 = 15
- The program first reads two integers: x and y
- It uses a for loop from 1 to x
- In each iteration, it multiplies i by y and prints the result