小编BiL*_*LAL的帖子

简化条件运算符python

我是编程的新手.有没有办法简化条件运算符

a = 50; b = 70; c = 60; 

# Classification 

if (a == b and b == c and c ==a):
   print('Equilateral triangle')

elif (a == b or b == c or c == a):
   print('Isosceles triangle')

elif (a!=b and b!=c and c!=a):
   print('Scalene triangle')
Run Code Online (Sandbox Code Playgroud)

python

0
推荐指数
1
解决办法
68
查看次数

标签 统计

python ×1