Title: Python index ValueError: substring not found - Softhints
Open Graph Title: Python index ValueError: substring not found - Softhints
X Title: Python index ValueError: substring not found - Softhints
Description: Often programmers with different background are confused by error: ValueError: substring not found when they are trying to find character in a stri
Open Graph Description: Often programmers with different background are confused by error: ValueError: substring not found when they are trying to find character in a string like: mystring = 'This is a simple string test].' begin = mystring.index('[') The behavior is not expected by many programmers to have an error for
X Description: Often programmers with different background are confused by error: ValueError: substring not found when they are trying to find character in a string like: mystring = 'This is a simple string test].' begin = mystring.index('[') The behavior is not expected by many programmers to have an error for
Opengraph URL: https://softhints.com/python-index-valueerror-substring-not-found/
Generator: Ghost 6.15
Domain: softhints.com
{
"@context": "https://schema.org",
"@type": "Article",
"publisher": {
"@type": "Organization",
"name": "SoftHints - Python, Linux, Pandas ",
"url": "https://softhints.com/",
"logo": {
"@type": "ImageObject",
"url": "https://softhints.com/content/images/2023/01/owl-1.webp"
}
},
"author": {
"@type": "Person",
"name": "John D K",
"image": {
"@type": "ImageObject",
"url": "https://softhints.com/content/images/2022/11/publish.png",
"width": 397,
"height": 347
},
"url": "https://softhints.com/author/john/",
"sameAs": [
"https://datascientyst.com/"
]
},
"headline": "Python index ValueError: substring not found - Softhints",
"url": "https://softhints.com/python-index-valueerror-substring-not-found/",
"datePublished": "2018-08-27T07:15:13.000Z",
"dateModified": "2022-02-10T09:08:39.000Z",
"image": {
"@type": "ImageObject",
"url": "https://softhints.com/content/images/2020/07/cubes-2492010_640_2.jpg",
"width": 640,
"height": 341
},
"keywords": "Python Errors",
"description": "Often programmers with different background are confused by error:\n\n\n\n\n\nValueError: substring not found\n\n\n\nwhen they are trying to find character in a string like:\n\n\nmystring = 'This is a simple string test].'\nbegin = mystring.index('[')\n\n\n\nThe behavior is not expected by many programmers to have an error for this search. A more expected behavior is to get -1 or not found instead of error. This can be done by using method find():\n\n\nmystring = 'This is a simple string test].'\nbegin = mystring.fin",
"mainEntityOfPage": "https://softhints.com/python-index-valueerror-substring-not-found/"
}
| referrer | no-referrer-when-downgrade |
| og:site_name | SoftHints - Python, Linux, Pandas |
| og:type | article |
| og:image | https://softhints.com/content/images/2020/07/cubes-2492010_640_2.jpg |
| article:published_time | 2018-08-27T07:15:13.000Z |
| article:modified_time | 2022-02-10T09:08:39.000Z |
| article:tag | Python Errors |
| article:publisher | https://www.facebook.com/Softhints |
| twitter:card | summary_large_image |
| twitter:url | https://softhints.com/python-index-valueerror-substring-not-found/ |
| twitter:image | https://softhints.com/content/images/2020/07/cubes-2492010_640_2.jpg |
| twitter:label1 | Written by |
| twitter:data1 | John D K |
| twitter:label2 | Filed under |
| twitter:data2 | Python Errors |
| og:image:width | 640 |
| og:image:height | 341 |
| ahrefs-site-verification | b698dadbc61303455425798abc6d83db9979f2794d33430a3e859736810dda29 |
Links:
Viewport: width=device-width, initial-scale=1