Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Articles by Ranbir Kapoor
1 articles
Python Program to Subtract K from each digit
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 MoreShowing 1–1 of 1 articles
« Prev
1
Next »
Advertisements