Write the program in python with maximum three lines of code and that assigns first 5 multiples of a number to 5 variables then print them
Answers
Answered by
17
Answer:
Here we use the range () which just stores the multiples. and then store the result of that function in a variable.
Code is written in python. Which will calculate first 5 multiples of a number given by user.
def multiple(a, b):
s = range(b, (a * b)+1, b)
print(*s)
a= 5
b= 2
multiple(a, b)
Answered by
21
Answer:
x=int(input("Enter the number:"))
for i in range (1,6):
print(x*i)
Explanation:
thats it
Similar questions