Back

python program to print the first 3 multiples of a number in the same line. how to remove space at the end

Created 3 years ago
66 Views
3 Comments
saiK8cVCA
@saiK8cVCA
saiK8cVCA
@saiK8cVCAProfile is locked. Login

userInput = input()

data = int(userInput)

i = 1

multiples = []
while(i<4):

multiples.append(i*data)

i = i+1

for c in multiples:

print(c, end = " ")

Expected output :

input : 2

output : 2 4 6

My output: 2

output: 2 4 6

I have space after 6 at the end

Comments (3)
Please login to comment.