+ 1
How to put 2 if statement with different conditions in a single line using print() function ?
3 Answers
+ 1
age = 25
print('Kid' if age < 18 else ( 'Adult' if age < 60 else 'Old'))
+ 5
a = 2
b = 3
c = 4
print(a if a > b else b if b > c else c)
0
Hi! please, show us at least your sample code, the task is not quite clear. have you tried doing it yourself?