# 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)
      

      Python language logoFirst Digit

      beginner
      playingWithNumbers

      To retrieve the first digit from a given number

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.