How can i set isdigit() command as a variable?

Posted by Nick on Stack Overflow See other posts from Stack Overflow or by Nick
Published on 2012-10-06T15:02:45Z Indexed on 2012/10/06 15:37 UTC
Read the original article Hit count: 223

Filed under:
|
|

I'm new to python but I caught on to the basics pretty quick and decided to start trying to make a program while I'm still learning, since I learn best by actually doing things.

So I'm making a program in python that will add polynomials and I need to see if a character from the parser is numeric im using the isdigit() command.

Instead of having to type isdigit() all the time in my code such as n.isdigit(), I want to assign it to a variable t = 'isdigit()' and then type n.t. This doesn't work, so is there an alternative to not typing the whole command?

© Stack Overflow or respective owner

Related posts about python

Related posts about variables