Write a function solution that returns an arbitrary integer which is greater than n, not greater than 10^9, and that ends with 0. You can assume that n is between 1 and 999,999,999. For example, given n=27, your function may return 60 and for n= 30, your function may return 40.
Answers
Answered by
5
Answer:
import math
min = round(n + 6, -1)
result = random.randrange(min, 1000000001, 10)
print(result)
Explanation:
Answered by
0
the solution that returns an arbitrary integer
Explanation:
the solution that returns an arbitrary integer that is greater than n, not greater than 10^9, and that ends with 0.
You can assume that n is between 1 and 999,999,999.
For example, given n=27, your function may return 60 and for n= 30, your function may return 40.
# Python program
n=int(input())
#find the last digit of n then
#find how much is left from the nearest multiple of 10
rem = 10-n%10
#print the nearest multiple of 10
print(n+rem)
Similar questions