I am scraping data from a dictionary and the returned data is H
or A
. In my for loop it is referred to as home_away = stats['home_away']
.
I changed the string name to h_a = home_away.replace("A","@")
That works fine, but I also want to change H
to " "
.
Would I do a if statement or a for loop for that?
I tried
if home_away == "H":
home_away.replace("H"," ")
elif home_away == "A":
home_away.replace("A","@")