What is the output of the following and explain it why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the output of the following and explain it why?

print('hi' if True else 'bye')

18th Jun 2020, 10:14 AM
Vikas Mishra
Vikas Mishra - avatar
1 Answer
+ 2
Further to Granger 's comment, try the following variant: print('hi' if False else 'bye')
18th Jun 2020, 11:01 AM
Rik Wittkopp
Rik Wittkopp - avatar