Source Code:
(back to article)
string = "Hello World" char = "z" try: position = string.index(char) print(position) except ValueError: print(f'{char} not found in {string}')
Result:
Report an issue