You’ve got two syntax errors, a spacing error, and you’re using a keyword which doesn’t exist.
if gameA>0.4 #<-- end this with a colon
profitA=profitA+1 #<-- needs more indent
end #<-- what is end?
All of that is repeated in gameB.
In addition:
profitAandprofitBaren’t defined intestAandtestB.testAis the same code astestB, which means that over time they will return about the same value.
solved Generate random numer in python?