0

if else statements in Python, Why is it giving output "No output", any explanation? Thanks!

if 1+1 == 2: if 2*2 == 8: print('excuted') else: print("failed")

25th Dec 2018, 11:40 PM
Nitish Ranjan
3 Respuestas
+ 1
if 1+1 == 2: if 2*2 == 8: print('excuted') else: print("failed") How indentation very important.
25th Dec 2018, 11:45 PM
ShortCode
0
if 1+1 == 2: #true if 2*2 == 8:#false The program ends
25th Dec 2018, 11:44 PM
ShortCode
0
@ShortCode Thanks! Yea, indentation is very important in Python. :)
25th Dec 2018, 11:50 PM
Nitish Ranjan