In this tutorial we learn how to make an run a function. To make a function just do fn (your function name)(){} then to run that just put (your function name)() inside the main function. Why use functions? Well it makes it so you only have to write code once!
In this post we learn how to import libraries as shown up above, by using the word “use”, we also make the variable mutable. We then take what the user typed in the console and print “you said:” what you typed into the console.
In this post we demonstrate if and else statements. In this case the value of x is “Hello World!” So x was printed 10times. However if x did not equal “Hello World!” Then the else statement would be triggered.
In this post I show you how to how to do a for loop, if you want to do a infinite loop just do loop{}, and for a while loop it’s just while then your argument.
Assigning variables in rust!
Try running this code...
Are you wondering why it only prints out “Hello World!”?
This is because “{}”, allows a variable to be printed as a string!