l
from random import choice
string = "Hello bitches, it's let"
def get_alphas(string):
return ''.join(filter(str.isalpha, string))
def star_replace(string: str, count: int) -> str:
if count > len(get_alphas(string)):
raise ValueError("count can't be bigger then count of alphabeth symbols in string")
for _ in range(count):
string = string.replace(choice(get_alphas(string)), '*', 1)
return string
print(star_replace(string, 3))