TWO ways to find character position in Python strings 🐍

Published: 23 January 2023
on channel: ModernPython
498
16

In this video, I'll show you two ways to find the character position in a Python string. With these techniques, you'll be able to access characters in a string in a simple and straightforward way.

.find( char ) and .index( char ) both return index of the character. The difference comes in when the character is missing. Find returns a -1 and index throws a ValueErrror.


Watch video TWO ways to find character position in Python strings 🐍 online without registration, duration hours minute second in high quality. This video was added by user ModernPython 23 January 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 498 once and liked it 16 people.