Lab 1.03 - Printing & Variables

Part 1 - Printing Practice

Practice typing out some statements in the editor part of the IDE, then hit "Run" at the top of the screen:

Expression Expected Output Did anything unexpected happen?
print("1")
print(1)
print(1 + 2)
print("1" + "2")
print("this" + " " + "is" + " " + "a" + " " + "sentence" + ".")

SNAP Flashback - Print Comparison

Part 2 - Variables Practice

  1. Type and run the following code.
    animal = "dogs"
    print(animal + " are really cool.")
    
    What happens? How would you make the program print out "cats are really cool" instead?


  2. Type and run the following code.
    print(dogs + " are cool.")
    
    What output does this produce? Why does this happen?


  3. Rewrite the following SNAP! program in Python: snap_blocks_variables

Bonus!

Print the output below, but only using one line of code. Feel free to use online resources.

Wow!
This is on a new line!