+ 1

Is there a better way to write it?

if user_num == '1' or user_num == '2' or user_num == '3' or user_num == '4' or user_num == '5' or user_num == '6' or user_num == '10': break Could anyone make this brief?

30th Jul 2021, 2:30 PM
Sanin NBCS
Sanin NBCS - avatar
1 Antwort
+ 26
Sanin NBCS a=[1,2,3,4,5,6,10] if user_num in a: break See how is it💙
30th Jul 2021, 2:35 PM
SωAti
SωAti - avatar