139k views
5 votes
Write the code for an if statement that adds 5 to the variable num1 if the value stored in the variable testA equals 25. Otherwise subtract 5 from num1.

User Egret
by
5.6k points

1 Answer

3 votes

In python

if testA == 25:

num1 += 5

else:

num1 -= 5

I hope this helps!

User Nuoritoveri
by
5.9k points