top of page

Logic: If/Else and Booleans

Up until now, all the programming has just been run once the computer gets to that line of code. If-statements allow you to tell the computer to only run a piece of code once a certain condition happens. In programming there are types like numbers or strings. There is another type which is called a Boolean. A boolean is a type that must be either true or false. You could just type in true or false and the boolean will either always run (if true) or never run (if false). You can also put in a variable that is related to a boolean. There are a number of different booleans that are listed below. You can also used the Logical Operators && (and) and || (or) to check multiple conditions at once. Project: Magic 8 Ball.

 
If/Else and Boolean code.
Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • LinkedIn Social Icon
  • Pinterest Social Icon
  • Facebook Basic Square

© 2023 by Coming Soon

Proudly created with Wix.com

bottom of page