Computer Science, asked by shubham31031991, 6 months ago

Write PYTHON program, which will print those numbers whose last digit is between 5 and 9.
e.g. 5, 6, 7, 8, 15, 16, 17, 18, 25, 26, ….

Answers

Answered by valeriy69
1

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

nums = [str(n) for n in range(5, 1000) if 5 <= n % 10 <= 9]

print("\n".join(nums))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by KartavyaAnadkat
0

Answer: x = int(input("Enter Range : "))

for i in range (1,x):

   if (i % 10) < 5:

       i += 1

   elif ((i % 10) >= 5) and ((i % 10) <9):

       print(i)

Explanation:

Similar questions