-2

I have 2 float variables var_a and var_b

I want to execute a program if both of them are greater than zero. I used the following snippet code

if(var_a > 0 and var_b > 0)
   execute()

It shows an error: invalid syntax. I also wanted to check if float variables can deal with 4 digits after decimals. If not what should be used?

jay las
  • 45
  • 7

1 Answers1

2

Add : to the end of the first line!

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
amasoudfam
  • 89
  • 5