Referenced from lesson Starting to Program

Make sure you’ve loaded the code.pyret.org editor, and clicked “Run”.

  1. Try typing 42 into the Interactions Area and hitting “Enter”. What happens?

  2. Try typing in other Numbers. What happens if you try a decimal like 0.5? A fraction like 1/3? Try really big Numbers, and really small ones.

  3. String values are always in quotes. Try typing your name (in quotes!). What happens when you hit Enter?

  4. Try typing your name with the opening quote, but without the closing quote. What happens? Now try typing it without any quotes.

  5. Is 42 the same as "42"? Why or why not? Write your answer below:

Operators

  1. Just like math, Pyret has operators like +, -, * and /. Try typing in 4 + 2, and then 4+2 (without the spaces). What can you conclude from this? Write your answer below:

  2. Type in the following expressions, one at a time: 4 + 2 + 6, 4 + 2 * 6, 4 + (2 * 6). What do you notice? Write your answer below:

  3. Try typing in 4 + "cat", and then "dog" + "cat". What can you conclude from this? Write your answer below:

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge Bootstrap:Data Science by Emmanuel Schanzer, Nancy Pfenning, Emma Youndtsmith, Jennifer Poole, Shriram Krishnamurthi, Joe Politz, Ben Lerner, Flannery Denny, and Dorai Sitaram with help from Eric Allatta and Joy Straub is licensed under a Creative Commons 4.0 Unported License. Based on a work at www.BootstrapWorld.org. Permissions beyond the scope of this license may be available by contacting schanzer@BootstrapWorld.org.