Answers for "how to detect the place of digit in python"

1

how to find 1 st digit in python

# Python Program to get the first digit of number

# take input
num = int(input('Enter any Number: '))

# convert int to string
num_str = str(num)

# get the first digit
first_digit = num_str[0]

# printing first digit of number
print('The first digit of number:', first_digit)
Posted by: Guest on October-09-2021
1

python check if number contains digit

for number in numbers:
    if '4' in str(number):
        print('{} True'.format(number))
    else:
        print("False")
Posted by: Guest on September-01-2021

Code answers related to "how to detect the place of digit in python"

Python Answers by Framework

Browse Popular Code Answers by Language