Check the code please | SoloLearn: Learn to code for FREE!

0

Check the code please

num=10 if num>6: print("greater than 6") else: if num<4: print("less than 4") else: if num==10: print("equals 10") else: print("neither") Please check if this will execute because there is an error showing in output

3/31/2020 2:57:57 PM

Deepshikha Chhaperia

1 Answer

New Answer

+3

Python is very specific about indentation. Your code should be like num=10 if num>6: print("greater than 6") else: if num<4: print("less than 4") else: if num==10: print("equals 10") else: print("neither") OR if num>6: print("greater than 6") elif num<4: print("less than 4") elif num==10: print("equals 10") else: print("neither")