22 lines
744 B
Python
22 lines
744 B
Python
# File: Pease-hw3d.py
|
|
# Author: PEASE, NICHOLAS
|
|
# Date: 05 OCT 2022
|
|
# Section: 1002-LAB
|
|
# E-mail: nicholas.pease@maine.edu
|
|
# Description:
|
|
# Write a small program that asks the user for two numbers (x, y). For each
|
|
# number from 1 to x (inclusive), print the first y multiples of that number on the same line.
|
|
# Keep repeating this action until the user inputs any negative number
|
|
# Collaboration:
|
|
# I collaborated with no one.
|
|
|
|
x=1;y=1
|
|
while x > 0 and y > 0:
|
|
y = int(input("Hello, what is your first number? "))
|
|
x = int(input("Hello, what is your second number? "))
|
|
for y_i in range(y):
|
|
x_list = [0]*(x)
|
|
for x_i in range(1,x+1):
|
|
x_list[x_i-1] = x_i+(y_i*x)
|
|
print(*x_list)
|
|
print("Goodbye") |