2nd Semester Intro to Computer Science

Do Now 1.04

1. In your Console

Type and run the following code

a = input("What is your name? ")
# a = "cats and dogs"
# meow
print("Hello there, " + a)

In your Notebook

Answer the following questions

  1. Read through the code and write down what you expect the printed results to be?
  2. Run the code and write down the actual printed result?
  3. Briefly describe what the # does?
  4. Briefly describe what input does?

Snap to Python

Convert the following to Python code:

Snap Input

Swapping

2. In your Console

Type and run the following

a = "this sentence should go second"
b = "this sentence should go first."  
# your code starts here

# your code ends here
print(a)
print(b)
  1. Run the program. What is the output?
  2. Write code to swap the values of variables a and b.

Edit this page Report an issue