Lily ho
0
Q:

golang while loop

package main

import "fmt"

func main(){
	//only one type of look in golang. A for loop. to make a while loop simple
    //emit all statments but the bools
    var x int = 10
    for x > 0{
    	fmt.Println(x)//this will print all numbers from 10-1
    	x--//decrement the x to make it go down by one each loop
    }
}
2
while (condition):
  doThis();
10
while (i < 10) {
  text += "The number is " + i;
  i++;
}
8

New to Communities?

Join the community