Ranbir Kapoor

Ranbir Kapoor

1 Articles Published

Articles by Ranbir Kapoor

1 articles

Python Program to Subtract K from each digit

Ranbir Kapoor
Ranbir Kapoor
Updated on 27-Mar-2026 201 Views

In this article, we will learn how to write a Python program that subtracts a given value K from each digit of numbers in a list. When the result becomes negative, we use 0 instead. Given an input list containing numbers and a K value, we subtract K from each individual digit and return the modified numbers. Example Let's understand with an example ? Input list = [1034, 356, 2145, 6712, 8671] K value = 3 For the number 1034, we subtract 3 from each digit: 1 − 3 = −2 ...

Read More
Showing 1–1 of 1 articles
« Prev 1 Next »
Advertisements