GolangCodingTime icon indicating copy to clipboard operation
GolangCodingTime copied to clipboard

c01/c01_06

Open utterances-bot opened this issue 3 years ago • 3 comments

1.6 数据类型:字典与布尔类型 — Go编程时光 1.0.0 documentation

https://golang.iswbm.com/c01/c01_06.html

utterances-bot avatar Aug 06 '22 02:08 utterances-bot

//  && 两边的表达式都会执行
fmt.Println( age > 18 && gender == "male")
// gender == "male" 并不会执行
fmt.Println( age < 18 || gender == "male")

这两行注释写反了吧

chenzhenhuaxin avatar Aug 06 '22 02:08 chenzhenhuaxin

应该是这样 // && 两边的表达式都会执行 fmt.Println( age < 18 && gender == "male")

xiaofu98 avatar Jan 31 '23 05:01 xiaofu98

// && 两边的表达式都会执行 fmt.Println( age > 18 && gender == "male") &&右边的不会执行了

Feanmy avatar Feb 20 '23 01:02 Feanmy