Python Forum
convert digits until a non-digit
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
convert digits until a non-digit
#1
i want to convert a string of digits (with maybe one fraction point for float) to a numeric and stop at the first digit that is not convertible so the caller gets the converted numeric value and how many digits were converted. maybe it would be a function that returns a 2-tuple or named sequence or some other way. does Python have anything built-in?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

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