s1='allaalrfal's2='al's3='zz'print(s1.replace(s2,s3,2))print(s1.replace(s2,s3))
Standard input is empty
zzlazzrfal zzlazzrfzz
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!