I wanna check a specific position in my string if it a character or not using isalpha the same by isdigit
I tried Using startswith and endswith but it didn’t work because I need to check only the start and the end of the string
I wanna check a specific position in my string if it a character or not using isalpha the same by isdigit
I tried Using startswith and endswith but it didn’t work because I need to check only the start and the end of the string
You can select the i-th character of your string like this: ith_character = string[i]
(starting with zero, of course). So, for example, if you'd like to check whether the third character is a digit, you'd write: string[2].isdigit()