replace all occurrences of character ‘r’ with ‘h’ in the String “Programmer”
Answers
Answered by
2
replace_char = lambda string, char: "".join(["h" if c == char else c for c in string])
print(replace_char("Programmer", "r"))
Similar questions
Math,
2 months ago
English,
2 months ago
Computer Science,
5 months ago
Physics,
10 months ago
Math,
10 months ago
Social Sciences,
10 months ago