What is problem here? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is problem here?

Sold_Hovercrafts=int(input()) Profit=(Sold_Hovercrafts *1000000) Overall_Profit=Profit-1000000 a=Overall_Profit if (a!=0 and a<6000000): print("Profit") else: if (a=0 or a<1000000): print("Loss") else: if a>=6000000: print("Broke Even")

10th May 2021, 6:56 AM
I am not a Programmer
I am not a Programmer - avatar
1 Answer
+ 1
On line 8, it's supposed to be == instead of just = = is used to assign a variable. == is used to compare between 2 values which is what I believe what this line is supposed to do. On line 9, 11, and 12, they have indentation error. Python does not know to which these expressions and statements belong to so indentation is important here. The fix from lines 8 to 12 would look like this: if (a==0 or a<1000000): print("Loss") else: if a>=6000000: print("Broke Even")
10th May 2021, 7:06 AM
RRINN
RRINN - avatar