题解 | #判断布尔值#
判断布尔值
https://www.nowcoder.com/practice/b8c8a1c5f57b4724a1cbc12eb50378a5
''' if int(input()): print('Hello World!') else: print('Erros!') ''' #三元运算符,a,if ? else b,if为真执行a,为假执行b print('Hello World!' if int(input()) else 'Erros!')
判断布尔值
https://www.nowcoder.com/practice/b8c8a1c5f57b4724a1cbc12eb50378a5
''' if int(input()): print('Hello World!') else: print('Erros!') ''' #三元运算符,a,if ? else b,if为真执行a,为假执行b print('Hello World!' if int(input()) else 'Erros!')
相关推荐