Python Forum
Function for returning absolute numbers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function for returning absolute numbers
#2
It run as expected here: Python 3.6. On 2.7 runs also.

sinstance(object, type or type tuple)

In your case isinstance(num, (int, float)) will return what you want

Repost your code in code tags so we can see the proper indentation
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: Function for returning absolute numbers - by wavic - Oct-02-2017, 05:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Generator: From Word to Numbers, from Numbers to n possibles Words Yamiyozx 2 1,520 Jan-02-2023, 05:08 PM
Last Post: deanhystad
  Convert list of numbers to string of numbers kam_uk 5 3,133 Nov-21-2020, 03:10 PM
Last Post: deanhystad
  Can anyone spot why this function is returning an empty list? hhydration 2 1,927 Nov-18-2020, 06:16 AM
Last Post: deanhystad
  HELP - Returning self numbers lower or equal to my argument Kokuzuma 4 2,815 Nov-01-2018, 06:35 PM
Last Post: Kokuzuma
  Why is this function returning none? wlsa 2 5,887 Sep-30-2018, 01:36 PM
Last Post: gruntfutuk
  Regular Expressions in Files (find all phone numbers and credit card numbers) Amirsalar 2 4,187 Dec-05-2017, 09:48 AM
Last Post: DeaD_EyE
  Function not returning correct value TsG009 4 4,227 Nov-24-2017, 09:07 PM
Last Post: sparkz_alot
  PyCharm Tutorial Links/Videos For Absolute Beginner? pyJim 3 5,325 Jan-24-2017, 10:40 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020