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 31-Jul-2023 189 Views

In this article, we will learn a python program to subtract K from each digit in a list. Assume we have taken an input list containing numbers and K value. We will now subtract k from each digit of a list element and print the resultant list using the below methods. Example Let inputList = [1034, 356, 2145, 6712, 8671] Given input k value = 3 Now we consider 1st element i.e, 1034 Subtract 3 from each digit of 1034 i.e, 1-3 =-2. So, it is ceiled to 0 0-3 = -3. So, it is ceiled to ...

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