Explica este c贸digo Python
Dificultad: F谩cil
mensaje = "Mi amigo Pedro juega f煤tbol. !Que bien juega Pedro隆"
print(mensaje.replace("Pedro", "Carlos", 1))
馃憠 A. Mi amigo Carlos juega f煤tbol. !Que bien juega Carlos隆
馃憠 B. Mi amigo Carlos juega f煤tbol. !Que bien juega Pedro隆
馃憠 C. Mi amigo Pedro juega f煤tbol. !Que bien juega Pedro隆
馃憠 D. Ninguno de los anteriores
馃憠 B. La funci贸n En nuestro ejemplo solo queremos que se haga 1 vez. Respuesta:
Mi amigo Carlos juega f煤tbol. !Que bien juega Pedro隆
replace
de Python permite remplazar una cadena dada por otra. Por defecto remplaza todas las coincidencias que se encuentre pero podemos modificar este comportamiento.replace
recibe un tercer argumento de tipo entero que representa la cantidad de veces que queremos que se haga el remplazo.