To determine if a string is a number

Asked 2 years ago, Updated 2 years ago, 25 views

When a string is entered in a variable, all the strings are integers How do I change the variable type to int and leave the str string if it is mixed with integers and characters?

python

2022-09-21 12:44

1 Answers

string = '12345'
string.isnumeric() # true

Take advantage of this.


2022-09-21 12:44

If you have any answers or tips


© 2025 OneMinuteCode. All rights reserved.