First Digit

    0

    0

    Mahendra Kumar

    beginnerplayingWithNumbers

    To retrieve the first digit from a given number

    # take input
    num = int(input('Enter any Number: '))
    # get the first digit
    while (num >= 10):
        num = num // 10
    # printing first digit of number
    print('The first digit of number:', num)
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.