Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allow only digit
#2
The str class has method isdigit():

In [1]: x = 'faw23'

In [2]: y = '28539'

In [3]: x.isdigit()
Out[3]: False

In [4]: y.isdigit()
Out[4]: True
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
Allow only digit - by penoxcz - Nov-14-2017, 09:57 AM
RE: Allow only digit - by wavic - Nov-14-2017, 10:42 AM
RE: Allow only digit - by penoxcz - Nov-14-2017, 01:22 PM
RE: Allow only digit - by wavic - Nov-14-2017, 03:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  list digit into number Voldyy 2 1,557 Jul-10-2022, 06:13 PM
Last Post: deanhystad
  Frequency in first digit from csv file, NO IMPORT bryan0901 6 2,866 May-28-2020, 09:50 AM
Last Post: bryan0901
  Four-digit number text translation. soz 3 2,699 May-13-2019, 03:02 PM
Last Post: buran
  create three digit numbers Krszt 4 4,515 Dec-09-2018, 03:12 PM
Last Post: ThePhi
  Sum of digit in a string MEH012 1 9,507 Apr-20-2018, 02:13 AM
Last Post: Larz60+
  Four digit combinations EHod 4 7,808 Aug-13-2017, 09:14 PM
Last Post: EHod

Forum Jump:

User Panel Messages

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