Latest web development tutorials

Python comprend des exercices 62

Python 100 Li Python 100 Li

Titre: chaîne de recherche.

Analyse du programme: Aucun.

Source Code:

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

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

L'exemple ci-dessus sortie est:

2

Python 100 Li Python 100 Li