Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

is numeric python

is numeric:

  •  Is numeric is the built-in method that is used to check whether the string contains numbers or not.
  • It returns the true when the string contains numbers, if the string does not contain numbers then it returns false.
  • It is applicable for integers, Unicode values. and takes the exponents like 1/2.
  • It is not applicable for float and negative values.
  •  isnumeric does not have any parameters.
  • For negative values to check whether they are numeric or not we have to remove the negative sign.
syntax:  str.isnumeric()

Example: a="12345"

                 a=str.isnumeric(a)

                 true

#write a python program to demonstrate the isnumeric function.

  1. x="34567"
  2. x=str.isnumeric(x)
  3. print(x)
  4. y="123abc"
  5. y=str.isnumeric(y)
  6. priny(y)
  7. z="asd13434656"
  8. z=str.isnumeric(z)
  9. print(z)
output: true
             false
             false






This post first appeared on Java Tutorial - InstanceOfJava, please read the originial post: here

Share the post

is numeric python

×

Subscribe to Java Tutorial - Instanceofjava

Get updates delivered right to your inbox!

Thank you for your subscription

×