0
Please is the indentation wrong wrong cuz I keep getting error in indentation. I nested the second if statement
number = 28 guess = int(input('Enter a number : ')) if guess==number: print('Congrats, you guessed it right!') if guess<number: print('No, Its a bit higher than that!')
5 Answers
+ 1
okay, good. well just put both if statements on the same indent level and you are golden
0
you shouldnât nest the second if statement. now it will only check whether or not the number is smaller than ânumberâ when it is already the same ==
so make both if statements same indentation and it will work
0
Are there any conditions for nesting if statements? I'm really confused right now. I know a nested if statement wont be executed when the outer if statement is false. I know this, but i was surprised the code didn't request for my input first to confirm whether the first condition will be satisfied or not before moving to the nested one.
0
can you put a link to your code here? by using the plus button to the left.
because when I run this code it does ask for an input as it should.
perhaps you copied it differently?
0
Here is it
https://code.sololearn.com/cQ69fXVTXlsb/?ref=app
Edit ; It's working fine now