Answers for "python find the numbers in the thousands, hundreds, units, tens value"

1

python find the numbers in the thousands, hundreds, units, tens value

""" 
"//" in Python stands for integer division => it removes the fractional part of a floating point number and returns an integer
for example
4/3 = 1.33333
4//3 = 1
"""
num = 1234

thousands = num // 1000
hundreds = (num % 1000) // 100
tens = (num % 100) // 10
units = (num % 10)

print(thousands, hundreds, tens, units)
# expected output: 1 2 3 4
Posted by: Guest on June-08-2021

Code answers related to "python find the numbers in the thousands, hundreds, units, tens value"

Python Answers by Framework

Browse Popular Code Answers by Language