Logic Control
Codes:
package main
import "fmt"
func main() {
i := 1
for i <= 10 {
fmt.Println(i)
i = i + 1
}
}Output:
1
2
3
4
5
6
7
8
9
10Conclusion:
Codes:
Conclusion:
We haven't finished yet. The most important control method is if and else.
if and else.It's definitely inherited from C++, I can feel it.
C++, I can feel it.I must say, compare to Python, you have to write more codes to reach the same goal.
Last updated