WAP to print first five multiple of any number in Python
Answers
Answered by
8
To print the first 5 multiples, we need to multiply the number with 1,2,3,4 and 5 and we need to print them out.
CODE:
n = int(input('Enter your number:'))
print([x*n for x in range(1,n+1)])
________________________________
Now, we will be getting our first five multiples. I took a range from 1 to 6 so that 1,2,3,4, and 5 would be counted and multiplied the number with our number and then print these multiples in a list.
Answered by
1
Answer:
A python program...
x = int(input("Enter a number: "))
print("First five multiples of", x, '=', end=' ')
for i in range(1, 6):
print(x*i, end=', ')
# HOPE THIS HELPS YOU!!
Similar questions
English,
6 months ago
Computer Science,
6 months ago
Math,
6 months ago
History,
1 year ago
Science,
1 year ago