Why error... Tell mistake or correct plz | SoloLearn: Learn to code for FREE!

+1

Why error... Tell mistake or correct plz

if num = 0.4: print("num")

8/3/2019 12:32:52 PM

Ateex Taseer

6 Answers

New Answer

+9

To compare equality you use "==". "=" is a purely assignment operator and for simplicity sake, if you use assignment as a value you get errors.

+8

"=" assigns a value "==" will check conditions.

+4

The mistake is from the definition of your variable. Your number has decimal point, so you have to define it properly with the "double" Try: if (double num ==0.4); print(num)

+1

if num == 0.4: print("num")

0

if "num" == 0.4: print("num") I rewrite it as this👆👆 Still No output What should I do to get an output Concept?

0

What exactly do you need to do?