Latest web development tutorials

Python incluye ejercicios 62

Python 100 Li Python 100 Li

Título: cadena de búsqueda.

Análisis del programa: Ninguno.

Código fuente:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

sStr1 = 'abcdefg'
sStr2 = 'cde'
print sStr1.find(sStr2)

La salida del ejemplo anterior es:

2

Python 100 Li Python 100 Li