+ 2
Why isn't my python program working?
4 Answers
+ 3
I don't know why thousands of beginner always use wrong indentation.Always indent your code in right way.
and if you are taking input from user it is always in string so you need to convert it into integer if you want,so you can work with it.
This is right code check it.
https://code.sololearn.com/cwmcA56504oR/?ref=app
+ 3
Maninder $ingh I'm afraid your indentation is wrong đ
if x>=1:
print("Your number is greater or equal to 1. The program will continue running...")
if x<=10:
print("Your number is smaller or equal to 10. Therefore your number is between 1 and 10")
else:
print("Invalid input.")
If "if x<=10" is not indentend, the conclusion "Your number is smaller or equal to 10. Therefore your number is between 1 and 10" is logically incorrect. It's only correct if lines 3 and 4 are indented.
+ 1
Anna great. I don't read this code logic that's why i indent like this way.
+ 1
Thank you Anna and Maninder $ingh !