lundi 1 février 2016

How to I check that a string contains only digits and / in python?

I am trying to check that a string contains only / and digits, to use as a form of validation, however I cannot find and way to do both. ATM I have this:

if Variable.isdigit() == False:

This works for the digits but I have not found a way to check also for the slashes.

Aucun commentaire:

Enregistrer un commentaire