1 lenI play the guitar 17 play 2

  • Slides: 11
Download presentation

1 - בחן את עצמך len('I play the guitar') 17 ‘play' * 2 'play'

1 - בחן את עצמך len('I play the guitar') 17 ‘play' * 2 'play' 'I play the guitar'[4] 'a' 'I play the guitar'[5: ] 'y the guitar' 'I play the guitar'[-3] 't' 'I play the guitar'[: ] 'I play the guitar'[: : 2] ‘Ipa h utr’ print 'I play the guitar'[: : -1] ‘ratiug eht yalp I’ print 'I play the guitar'[: : -2] 'rtu h ap. I' 'זוהר ופרלמן רחל Iahur' ד"ר דורון print 'I play the guitar'[: : 4]

2 - בחן את עצמך 'y' in 'I play the guitar' True 'z' in

2 - בחן את עצמך 'y' in 'I play the guitar' True 'z' in 'I play the guitar' False print 'I play the guitar'. find('p') 2 print 'I play the guitar'. find('p', 3, 10) -1 'I play the guitar'. index('the', 3, 10 ) 7 'GUITAR'. lower() 'guitar' ‘guitar'. endswith(‘t’) False 'I play the Guitar'. startswith('play', 2, 17) True 'This is a new car'. replace("is", "was") " דורון זוהר ופרלמן רחל , " ד"ר #", 1) print 'This is a new car'. replace(" This#is a new